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

Function approvalTerms

packages/plugins/mcp/src/sdk/invoke.ts:258–267  ·  view source on GitHub ↗
(meta: Record<string, unknown> | undefined)

Source from the content-addressed store, hash-verified

256 typeof value === "string" || isStringList(value);
257
258export const approvalTerms = (meta: Record<string, unknown> | undefined) => {
259 if (meta === undefined) return {};
260 const terms = Object.fromEntries(
261 APPROVAL_TERM_KEYS.flatMap((key) => {
262 const value = meta[key];
263 return isApprovalTerm(value) ? [[key, value] as const] : [];
264 }),
265 );
266 return Object.keys(terms).length > 0 ? { meta: terms } : {};
267};
268
269const toElicitationRequest = (params: McpElicitParams): ElicitationRequest => {
270 const meta = approvalTerms(params._meta);

Callers 2

toElicitationRequestFunction · 0.85

Calls 1

isApprovalTermFunction · 0.85

Tested by

no test coverage detected