vapor-chamber API reference - v1.16.0
    Preparing search index...

    Function busToMcpTools

    • Convert a BusSchema into MCP tool definitions (the tools/list shape).

      Mirrors toAnthropicTools (from the schema module): each action becomes one tool, with target and payload as nested object properties. Field types map 1:1 to JSON Schema types; 'any' fields get no type constraint and are excluded from required (all other fields are required).

      Parameters

      Returns McpTool[]

      const tools = busToMcpTools({
      cartAdd: { description: 'Add item', target: { id: 'number' }, payload: { qty: 'number' } },
      });
      // → [{ name: 'cartAdd', description: 'Add item', inputSchema: {
      // type: 'object',
      // properties: {
      // target: { type: 'object', properties: { id: { type: 'number' } }, required: ['id'] },
      // payload: { type: 'object', properties: { qty: { type: 'number' } }, required: ['qty'] },
      // },
      // required: ['target', 'payload'],
      // } }]