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

Function inspect

packages/hosts/mcp/src/tool-server-protocol.test.ts:144–168  ·  view source on GitHub ↗
(appsEnabled: boolean)

Source from the content-addressed store, hash-verified

142
143 it("registers app metadata and app-only tools only for apps-enabled requests", async () => {
144 const inspect = async (appsEnabled: boolean) => {
145 let observed:
146 | {
147 readonly names: readonly string[];
148 readonly createMeta: Record<string, unknown> | undefined;
149 readonly resourceCount: number;
150 }
151 | undefined;
152 await withClient(
153 {
154 engine: makeStubEngine(),
155 appsEnabled,
156 loadAppShellHtml: async () => "<html></html>",
157 },
158 async (client) => {
159 const tools = (await client.listTools()).tools;
160 observed = {
161 names: tools.map(({ name }) => name),
162 createMeta: tools.find(({ name }) => name === "create-artifact")?._meta,
163 resourceCount: (await client.listResources()).resources.length,
164 };
165 },
166 );
167 return observed;
168 };
169
170 const enabled = await inspect(true);
171 expect(enabled?.names).toContain("execute-action");

Callers 3

runFunction · 0.85
runFunction · 0.85

Calls 2

withClientFunction · 0.70
makeStubEngineFunction · 0.70

Tested by

no test coverage detected