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

Function getToolSummaryKeys

sdk/coding-agent-cli/src/agent.ts:534–561  ·  view source on GitHub ↗
(toolName: string)

Source from the content-addressed store, hash-verified

532}
533
534function getToolSummaryKeys(toolName: string) {
535 const name = toolName.toLowerCase()
536
537 if (name.includes("read")) {
538 return [["path", "filePath", "target_file", "absolutePath"], ["offset"], ["limit"]]
539 }
540
541 if (name.includes("glob")) {
542 return [["pattern", "glob", "glob_pattern"], ["path", "cwd", "target_directory"]]
543 }
544
545 if (name.includes("grep") || name.includes("search")) {
546 return [["pattern", "query"], ["path"], ["glob"], ["type"]]
547 }
548
549 if (name.includes("shell") || name.includes("terminal") || name.includes("command")) {
550 return [["command", "cmd"], ["cwd", "working_directory"]]
551 }
552
553 if (name.includes("edit") || name.includes("write") || name.includes("patch")) {
554 return [["path", "target_file", "file"], ["instruction"]]
555 }
556
557 return [
558 ["path", "file", "target_file"],
559 ["pattern", "query", "command"],
560 ]
561}
562
563function summarizeFirstValue(record: Record<string, unknown>, keys: string[]) {
564 for (const key of keys) {

Callers 1

summarizeToolArgsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected