MCPcopy Index your code
hub / github.com/anomalyco/opencode / requiredString

Function requiredString

packages/opencode/src/session/tools.ts:510–514  ·  view source on GitHub ↗
(args: Record<string, unknown>, key: string)

Source from the content-addressed store, hash-verified

508}
509
510function requiredString(args: Record<string, unknown>, key: string) {
511 const value = optionalString(args, key)
512 if (value) return value
513 throw new Error(`${key} is required`)
514}
515
516function formatMcpResource(resource: MCP.Resource) {
517 const result = Object.fromEntries(Object.entries(resource).filter((entry) => entry[0] !== "client"))

Callers 1

parseReadMcpResourceArgsFunction · 0.85

Calls 1

optionalStringFunction · 0.85

Tested by

no test coverage detected