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

Function snapshotFor

e2e/scenarios/tool-descriptions.test.ts:358–382  ·  view source on GitHub ↗
(slug: string)

Source from the content-addressed store, hash-verified

356 // The agent-visible surface: catalog entry + schema view (the same
357 // data `tools.search()` / `tools.describe.tool()` serve the sandbox).
358 const snapshotFor = (slug: string) =>
359 Effect.gen(function* () {
360 const tools = yield* apiClient.tools.list({
361 query: { integration: IntegrationSlug.make(slug) },
362 });
363 return yield* Effect.forEach(
364 [...tools].sort((a, b) => a.name.localeCompare(b.name)),
365 (tool) =>
366 Effect.gen(function* () {
367 const schema = yield* apiClient.tools.schema({
368 query: { address: tool.address },
369 });
370 return {
371 name: tool.name,
372 address: String(tool.address),
373 listDescription: tool.description,
374 schemaDescription: schema.description,
375 inputTypeScript: schema.inputTypeScript,
376 outputTypeScript: schema.outputTypeScript,
377 typeScriptDefinitions: schema.typeScriptDefinitions,
378 inputSchema: schema.inputSchema,
379 } satisfies ToolSnapshot;
380 }),
381 );
382 });
383
384 const openapiTools = yield* snapshotFor(openapiSlug);
385 const graphqlTools = yield* snapshotFor(graphqlSlug);

Callers 1

Calls 1

listMethod · 0.65

Tested by

no test coverage detected