()
| 28 | } |
| 29 | |
| 30 | func (t *ReadTool) InputSchema() map[string]any { |
| 31 | return map[string]any{ |
| 32 | "type": "object", |
| 33 | "properties": map[string]any{ |
| 34 | "file_path": map[string]any{ |
| 35 | "type": "string", |
| 36 | "description": "要读取的文件路径,必须是绝对路径", |
| 37 | }, |
| 38 | "offset": map[string]any{ |
| 39 | "type": "integer", |
| 40 | "description": "读取的起始行号(从1开始计数),默认为1", |
| 41 | }, |
| 42 | "limit": map[string]any{ |
| 43 | "type": "integer", |
| 44 | "description": "读取的最大行数,默认读取整个文件", |
| 45 | }, |
| 46 | }, |
| 47 | "required": []string{"file_path"}, |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func (t *ReadTool) Execute(ctx context.Context, input map[string]any, tc *tools.ToolContext) (any, error) { |
| 52 | // 获取参数 |
no outgoing calls