MCPcopy Create free account
hub / github.com/anus-dev/ANUS / ToolBuilder

Interface ToolBuilder

packages/core/src/tools/tools.ts:93–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91 * Interface for a tool builder that validates parameters and creates invocations.
92 */
93export interface ToolBuilder<
94 TParams extends object,
95 TResult extends ToolResult,
96> {
97 /**
98 * The internal name of the tool (used for API calls).
99 */
100 name: string;
101
102 /**
103 * The user-friendly display name of the tool.
104 */
105 displayName: string;
106
107 /**
108 * Description of what the tool does.
109 */
110 description: string;
111
112 /**
113 * The kind of tool for categorization and permissions
114 */
115 kind: Kind;
116
117 /**
118 * Function declaration schema from @google/genai.
119 */
120 schema: FunctionDeclaration;
121
122 /**
123 * Whether the tool's output should be rendered as markdown.
124 */
125 isOutputMarkdown: boolean;
126
127 /**
128 * Whether the tool supports live (streaming) output.
129 */
130 canUpdateOutput: boolean;
131
132 /**
133 * Validates raw parameters and builds a ready-to-execute invocation.
134 * @param params The raw, untrusted parameters from the model.
135 * @returns A valid `ToolInvocation` if successful. Throws an error if validation fails.
136 */
137 build(params: TParams): ToolInvocation<TParams, TResult>;
138}
139
140/**
141 * New base class for tools that separates validation from execution.

Callers 8

esbuild.config.jsFile · 0.65
web-search.test.tsFile · 0.65
buildAndExecuteFunction · 0.65
silentBuildFunction · 0.65
read-file.test.tsFile · 0.65
mcp-tool.test.tsFile · 0.65
glob.test.tsFile · 0.65

Implementers 1

TestToolpackages/core/src/tools/tools.test.ts

Calls

no outgoing calls

Tested by

no test coverage detected