@gibme/webserver
    Preparing search index...

    Variable ToolConst

    Tool: <
        ToolInputType extends ZodRawShapeCompat = ZodRawShapeCompat,
        ToolOutputType extends ZodRawShapeCompat = ZodRawShapeCompat,
    >(
        tool: McpTool<ToolInputType, ToolOutputType>,
    ) => McpTool<ToolInputType, ToolOutputType> = define_mcp_tool

    Type Declaration

      • <
            ToolInputType extends ZodRawShapeCompat = ZodRawShapeCompat,
            ToolOutputType extends ZodRawShapeCompat = ZodRawShapeCompat,
        >(
            tool: McpTool<ToolInputType, ToolOutputType>,
        ): McpTool<ToolInputType, ToolOutputType>
      • Identity helper that locks in inputSchema / outputSchema inference for an inline tool descriptor. Use when writing tools as array elements of tools: McpTool[], where the array element type otherwise falls back to the default ZodRawShapeCompat generics and widens the callback return type. Wrapping the descriptor with define_mcp_tool({...}) causes TS to solve ToolInputType and ToolOutputType from the literal inputSchema / outputSchema before checking the callback body, so contextual typing flows precisely into the return expression and content: [{ type: 'text', ... }] keeps its discriminator.

        Type Parameters

        • ToolInputType extends ZodRawShapeCompat = ZodRawShapeCompat
        • ToolOutputType extends ZodRawShapeCompat = ZodRawShapeCompat

        Parameters

        Returns McpTool<ToolInputType, ToolOutputType>