MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / getMethodValue

Function getMethodValue

src/server/mcp.ts:1516–1530  ·  view source on GitHub ↗
(schema: AnyObjectSchema)

Source from the content-addressed store, hash-verified

1514}
1515
1516function getMethodValue(schema: AnyObjectSchema): string {
1517 const shape = getObjectShape(schema);
1518 const methodSchema = shape?.method as AnySchema | undefined;
1519 if (!methodSchema) {
1520 throw new Error('Schema is missing a method literal');
1521 }
1522
1523 // Extract literal value - works for both v3 and v4
1524 const value = getLiteralValue(methodSchema);
1525 if (typeof value === 'string') {
1526 return value;
1527 }
1528
1529 throw new Error('Schema method literal must be a string');
1530}
1531
1532function createCompletionResult(suggestions: string[]): CompleteResult {
1533 return {

Calls 2

getObjectShapeFunction · 0.85
getLiteralValueFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…