MCPcopy Create free account
hub / github.com/continuedev/continue / formatToolArgument

Function formatToolArgument

extensions/cli/src/tools/formatters.ts:8–23  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

6 * @returns A formatted string representation of the value
7 */
8export function formatToolArgument(value: any): string {
9 if (value === null || value === undefined) {
10 return "";
11 }
12
13 // Convert absolute paths to relative paths
14 if (typeof value === "string" && path.isAbsolute(value)) {
15 const workspaceRoot = process.cwd();
16 const relativePath = path.relative(workspaceRoot, value);
17 // Normalize path separators to forward slashes for cross-platform consistency
18 return (relativePath || value).replace(/\\/g, "/");
19 }
20
21 // Return other values as strings
22 return String(value);
23}

Callers 3

ToolCallTitleFunction · 0.85
listFiles.tsFile · 0.85
readFile.tsFile · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected