MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / makeTool

Function makeTool

src/runtime/__tests__/tool-invoker.test.ts:97–120  ·  view source on GitHub ↗
(opts: {
  cliName: string;
  mcpName?: string;
  id?: string;
  nextStepTemplates?: ToolDefinition['nextStepTemplates'];
  workflow: string;
  stateful: boolean;
  handler: ToolDefinition['handler'];
  xcodeIdeRemoteToolName?: string;
})

Source from the content-addressed store, hash-verified

95}
96
97function makeTool(opts: {
98 cliName: string;
99 mcpName?: string;
100 id?: string;
101 nextStepTemplates?: ToolDefinition['nextStepTemplates'];
102 workflow: string;
103 stateful: boolean;
104 handler: ToolDefinition['handler'];
105 xcodeIdeRemoteToolName?: string;
106}): ToolDefinition {
107 return {
108 id: opts.id,
109 cliName: opts.cliName,
110 mcpName: opts.mcpName ?? opts.cliName.replace(/-/g, '_'),
111 nextStepTemplates: opts.nextStepTemplates,
112 workflow: opts.workflow,
113 description: `${opts.cliName} tool`,
114 mcpSchema: { value: z.string().optional() },
115 cliSchema: { value: z.string().optional() },
116 stateful: opts.stateful,
117 xcodeIdeRemoteToolName: opts.xcodeIdeRemoteToolName,
118 handler: opts.handler,
119 };
120}
121
122function invokeAndFinalize(
123 invoker: DefaultToolInvoker,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected