MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / getFilePathFromToolInput

Function getFilePathFromToolInput

src/utils/collapseReadSearch.ts:93–98  ·  view source on GitHub ↗

* Extract the primary file/directory path from a tool_use input. * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob).

(toolInput: unknown)

Source from the content-addressed store, hash-verified

91 * Handles both `file_path` (Read/Write/Edit) and `path` (Grep/Glob).
92 */
93function getFilePathFromToolInput(toolInput: unknown): string | undefined {
94 const input = toolInput as
95 | { file_path?: string; path?: string; pattern?: string; glob?: string }
96 | undefined
97 return input?.file_path ?? input?.path
98}
99
100/**
101 * Check if a search tool use targets memory files by examining its path, pattern, and glob.

Callers 1

isMemoryWriteOrEditFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected