import type { z, ZodRawShape } from 'zod'; import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; import type { Toolset } from './constants.js'; /** * Result returned from MCP tool execution. * Matches the MCP SDK's CallToolResult type. */ export type ToolResult = CallToolResult; /** * Configuration for an MCP tool. */ export interface McpToolConfig { /** Tool name (used in MCP protocol) */ name: string; /** Human-readable description */ description: string; /** Zod schema for input validation */ inputSchema: T; /** Toolsets this tool belongs to */ toolsets: Toolset[]; /** Whether this tool is GA (generally available) */ isGA?: boolean; } /** * MCP Tool definition with handler. */ export interface McpTool extends McpToolConfig { /** Handler function that executes the tool */ handler: (args: z.infer>) => Promise; } /** * Startup flags passed to the MCP server. */ export interface StartupFlags { /** Comma-separated list of toolsets to enable */ toolsets?: string[]; /** Specific individual tools to enable */ tools?: string[]; /** Allow non-GA (experimental) tools */ allowNonGaTools?: boolean; /** Path to config file (dw.json format) */ configPath?: string; /** Project project directory for tools (auto-discovery, scaffolding, etc.) */ projectDirectory?: string; /** * Comma-separated allowlist of documentation categories the docs tools may * expose (from `--docs-topics` / `SFCC_DOCS_TOPICS`). Bounds the whole docs * corpus at startup; unset means all categories. */ docsTopics?: string; }