summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/read-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/read-file.ts')
-rw-r--r--packages/core/src/tools/read-file.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/core/src/tools/read-file.ts b/packages/core/src/tools/read-file.ts
index a2ff89c1..9ba80672 100644
--- a/packages/core/src/tools/read-file.ts
+++ b/packages/core/src/tools/read-file.ts
@@ -7,7 +7,7 @@
import path from 'path';
import { SchemaValidator } from '../utils/schemaValidator.js';
import { makeRelative, shortenPath } from '../utils/paths.js';
-import { BaseTool, ToolResult } from './tools.js';
+import { BaseTool, Icon, ToolLocation, ToolResult } from './tools.js';
import { Type } from '@google/genai';
import {
isWithinRoot,
@@ -51,6 +51,7 @@ export class ReadFileTool extends BaseTool<ReadFileToolParams, ToolResult> {
ReadFileTool.Name,
'ReadFile',
'Reads and returns the content of a specified file from the local filesystem. Handles text, images (PNG, JPG, GIF, WEBP, SVG, BMP), and PDF files. For text files, it can read specific line ranges.',
+ Icon.FileSearch,
{
properties: {
absolute_path: {
@@ -118,6 +119,10 @@ export class ReadFileTool extends BaseTool<ReadFileToolParams, ToolResult> {
return shortenPath(relativePath);
}
+ toolLocations(params: ReadFileToolParams): ToolLocation[] {
+ return [{ path: params.absolute_path, line: params.offset }];
+ }
+
async execute(
params: ReadFileToolParams,
_signal: AbortSignal,