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

Function detectFromBody

packages/core/sdk/src/insufficient-scope.ts:78–84  ·  view source on GitHub ↗
(body: unknown)

Source from the content-addressed store, hash-verified

76};
77
78const detectFromBody = (body: unknown): boolean => {
79 if (typeof body === "string") {
80 const parsed = parseJsonSafe(body);
81 return parsed !== undefined && detectFromStructured(parsed, 0);
82 }
83 return detectFromStructured(body, 0);
84};
85
86/** Strict detection over a text fragment whose JSON body survives only as a
87 * suffix of a transport error message (the MCP SDK embeds the failed POST's

Callers 1

detectInsufficientScopeFunction · 0.85

Calls 2

detectFromStructuredFunction · 0.85
parseJsonSafeFunction · 0.70

Tested by

no test coverage detected