Open
Description
Is your feature request related to a problem? Please describe.
The problem with the current server.tool()
implementations is that a tool is not treated as a monolith entity and rather treated as a set of separate variables, such as name, description, callback and others.
Example:
tool(name, description, inputParams, callback)
Describe the solution you'd like
I'd like to propose adding two things:
- Add a Tool type, similar to RegisteredTool, like this:
export type Tool = {
name: string;
description?: string;
inputSchema?: AnyZodObject;
callback: ToolCallback<undefined | ZodRawShape>;
};
- Add one more
server.tools()
implementation which accepts an object of the newly created Tool type:
tool(name: string, tool: Tool)
# or even better:
tool(tool: Tool)