summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/tool-registry.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/tool-registry.ts')
-rw-r--r--packages/core/src/tools/tool-registry.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/core/src/tools/tool-registry.ts b/packages/core/src/tools/tool-registry.ts
index 73b427d4..c77fab8c 100644
--- a/packages/core/src/tools/tool-registry.ts
+++ b/packages/core/src/tools/tool-registry.ts
@@ -366,6 +366,22 @@ export class ToolRegistry {
}
/**
+ * Retrieves a filtered list of tool schemas based on a list of tool names.
+ * @param toolNames - An array of tool names to include.
+ * @returns An array of FunctionDeclarations for the specified tools.
+ */
+ getFunctionDeclarationsFiltered(toolNames: string[]): FunctionDeclaration[] {
+ const declarations: FunctionDeclaration[] = [];
+ for (const name of toolNames) {
+ const tool = this.tools.get(name);
+ if (tool) {
+ declarations.push(tool.schema);
+ }
+ }
+ return declarations;
+ }
+
+ /**
* Returns an array of all registered and discovered tool instances.
*/
getAllTools(): AnyDeclarativeTool[] {