MCPcopy Index your code
hub / github.com/cursor/cookbook / summarizeToolArgs

Function summarizeToolArgs

sdk/coding-agent-cli/src/agent.ts:515–532  ·  view source on GitHub ↗
(toolName: string, args: unknown)

Source from the content-addressed store, hash-verified

513}
514
515function summarizeToolArgs(toolName: string, args: unknown) {
516 if (!args || typeof args !== "object") {
517 return undefined
518 }
519
520 const record = args as Record<string, unknown>
521 const keyGroups = getToolSummaryKeys(toolName)
522 const parts: string[] = []
523
524 for (const keys of keyGroups) {
525 const part = summarizeFirstValue(record, keys)
526 if (part) {
527 parts.push(part)
528 }
529 }
530
531 return parts.length > 0 ? parts.join(" ") : undefined
532}
533
534function getToolSummaryKeys(toolName: string) {
535 const name = toolName.toLowerCase()

Callers 1

emitSdkMessageFunction · 0.85

Calls 2

getToolSummaryKeysFunction · 0.85
summarizeFirstValueFunction · 0.85

Tested by

no test coverage detected