MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / projection

Function projection

packages/hosts/mcp/src/passthrough-tools.test.ts:30–56  ·  view source on GitHub ↗
(input: {
  readonly integration: string;
  readonly name: string;
  readonly owner?: "org" | "user";
  readonly connection?: string;
  readonly description?: string;
  readonly inputSchema?: unknown;
  readonly requiresApproval?: boolean;
  readonly static?: boolean;
})

Source from the content-addressed store, hash-verified

28// ---------------------------------------------------------------------------
29
30const projection = (input: {
31 readonly integration: string;
32 readonly name: string;
33 readonly owner?: "org" | "user";
34 readonly connection?: string;
35 readonly description?: string;
36 readonly inputSchema?: unknown;
37 readonly requiresApproval?: boolean;
38 readonly static?: boolean;
39}): Tool => {
40 const owner = input.owner ?? "org";
41 const connection = input.connection ?? "main";
42 return {
43 address: ToolAddress.make(`tools.${input.integration}.${owner}.${connection}.${input.name}`),
44 integration: IntegrationSlug.make(input.integration),
45 owner,
46 connection: ConnectionName.make(connection),
47 name: ToolName.make(input.name),
48 pluginId: "test",
49 description: input.description ?? `${input.integration} ${input.name}`,
50 ...(input.inputSchema === undefined ? {} : { inputSchema: input.inputSchema }),
51 ...(input.requiresApproval === undefined
52 ? {}
53 : { annotations: { requiresApproval: input.requiresApproval } }),
54 ...(input.static === undefined ? {} : { static: input.static }),
55 };
56};
57
58/** Exercise the existing list/schema seam and record which schemas were requested. */
59const toolPort = (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected