@modelcontextprotocol/sdk
    Preparing search index...

    Type Alias ToolCallback<InputArgs, OutputArgs>

    ToolCallback: InputArgs extends ZodRawShape
        ? (
            args: z.objectOutputType<InputArgs, ZodTypeAny>,
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | TypedCallToolResult<OutputArgs>
            | Promise<TypedCallToolResult<OutputArgs>>
        : (
            extra: RequestHandlerExtra<ServerRequest, ServerNotification>,
        ) =>
            | TypedCallToolResult<OutputArgs>
            | Promise<TypedCallToolResult<OutputArgs>>

    Callback for a tool handler registered with Server.tool().

    Parameters will include tool arguments, if applicable, as well as other request handler context.

    The callback should return:

    • structuredContent if the tool has an outputSchema defined
    • content if the tool does not have an outputSchema
    • Both fields are optional but typically one should be provided

    Type Parameters

    • InputArgs extends undefined | ZodRawShape = undefined
    • OutputArgs extends undefined | ZodRawShape = undefined