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

Function createCatalog

src/daemon/__tests__/tool-invoke-streaming.test.ts:22–35  ·  view source on GitHub ↗
(tools: ToolDefinition[])

Source from the content-addressed store, hash-verified

20}));
21
22function createCatalog(tools: ToolDefinition[]): ToolCatalog {
23 return {
24 tools,
25 getByCliName: (name) => tools.find((tool) => tool.cliName === name) ?? null,
26 getByMcpName: (name) => tools.find((tool) => tool.mcpName === name) ?? null,
27 getByToolId: (toolId) => tools.find((tool) => tool.id === toolId) ?? null,
28 resolve: (input) => {
29 const tool =
30 tools.find((candidate) => candidate.cliName === input) ??
31 tools.find((candidate) => candidate.mcpName === input);
32 return tool ? { tool } : { notFound: true };
33 },
34 };
35}
36
37async function createSocketPath(): Promise<string> {
38 const directory = await mkdtemp(path.join(tmpdir(), 'xcodebuildmcp-daemon-'));

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected