Files
GenericAgent/assets/tools_schema.json

71 lines
6.2 KiB
JSON

[
{"type": "function", "function": {
"name": "code_run",
"description": "Code executor. Prefer python. No concurrent calls. Put code in ```python/powershell blocks in reply body to avoid escaping. No hardcoding bulk data",
"parameters": {"type": "object", "properties": {
"script": {"type": "string", "description": "[Optional] Code to execute. Prefer code blocks in reply body to avoid escaping (leave empty when using code blocks)"},
"type": {"type": "string", "enum": ["python", "powershell"], "description": "Code type", "default": "python"},
"timeout": {"type": "integer", "description": "Timeout in seconds", "default": 60},
"cwd": {"type": "string", "description": "Working directory, defaults to cwd"}}}
}},
{"type": "function", "function": {
"name": "file_read",
"description": "Read file content. Read before modifying to get latest context and line numbers. Supports pagination and keyword search",
"parameters": {"type": "object", "properties": {
"path": {"type": "string", "description": "Relative or absolute file path"},
"start": {"type": "integer", "description": "Start line number (1-based)", "default": 1},
"count": {"type": "integer", "description": "Number of lines to read", "default": 200},
"keyword": {"type": "string", "description": "Optional search keyword. If provided, returns first match (case-insensitive) with surrounding context"},
"show_linenos": {"type": "boolean", "description": "Show line numbers. Recommended on to help file_patch locate content", "default": true}}, "required": ["path"]}
}},
{"type": "function", "function": {
"name": "file_patch",
"description": "Fine-grained local file edit. Finds unique old_content block and replaces with new_content. old_content must be unique in file with exact whitespace/indentation/newlines. On match failure, use file_read to re-check file content",
"parameters": {"type": "object", "properties": {
"path": {"type": "string", "description": "File path"},
"old_content": {"type": "string", "description": "Original text block to replace (must be unique in file)"},
"new_content": {"type": "string", "description": "New text content. Supports {{file:path:startLine:endLine}} syntax to reference file lines, auto-expanded before writing"}}, "required": ["path", "old_content", "new_content"]}
}},
{"type": "function", "function": {
"name": "file_write",
"description": "Create, overwrite or append files. Use file_patch for fine-grained edits. Content must be in <file_content> tags or code blocks in reply body. Supports {{file:path:startLine:endLine}} to reference file lines, auto-expanded before writing",
"parameters": {"type": "object", "properties": {
"path": {"type": "string", "description": "File path"},
"mode": {"type": "string", "enum": ["overwrite", "append", "prepend"], "description": "Write mode", "default": "append"}}, "required": ["path"]}
}},
{"type": "function", "function": {
"name": "web_scan",
"description": "Get simplified HTML and tab list of current page. Simplification filters sidebars/floating elements; use execute_js for filtered content. Call after switching pages",
"parameters": {"type": "object", "properties": {
"tabs_only": {"type": "boolean", "description": "Return only tab list and current tab info, no HTML", "default": false},
"switch_tab_id": {"type": "string", "description": "Optional tab ID. If provided, switches to that tab before scanning"},
"text_only": {"type": "boolean", "description": "Plain text only, no HTML", "default": false}}}
}},
{"type": "function", "function": {
"name": "web_execute_js",
"description": "Execute JS to control browser. Use precisely to reduce web_scan calls. Put code in ```javascript blocks in reply body to avoid escaping",
"parameters": {"type": "object", "properties": {
"script": {"type": "string", "description": "[Optional] JS code or path. Prefer code blocks in reply body to avoid escaping (mutually exclusive with this param)"},
"save_to_file": {"type": "string", "description": "Save result to file, for long return values", "default": ""},
"no_monitor": {"type": "boolean", "description": "Skip page change monitoring, saves 2-3s. Only set for pure reads, not for page actions", "default": false}}}
}},
{"type": "function", "function": {
"name": "update_working_checkpoint",
"description": "Short-term working notepad, auto-injected each turn to prevent info loss in long tasks. Call during early/mid stages, not at end. When: (1) after reading SOP, store user needs & key constraints (skip for simple 1-2 step tasks); (2) before subtask switch or context flush; (3) after repeated failures, re-read SOP and must store new findings; (4) on new task, update content, clear old progress but keep valid constraints.\n\nDon't call: simple tasks (1-2 steps), task completed (use long-term memory tool)",
"parameters": {"type": "object", "properties": {
"key_info": {"type": "string", "description": "Replaces current notepad (<200 tokens). Incremental update: review existing, keep valid, add/remove/modify. Store: pitfalls, user requirements, key params/findings, file paths, progress, next steps. Don't store: ephemeral info, obvious context, old task info when user switched tasks. Prefer over-updating over losing key info"},
"related_sop": {"type": "string", "description": "Related SOP name(s), re-read when needed"}}}
}},
{"type": "function", "function": {
"name": "ask_user",
"description": "Interrupt task to ask user when needing decisions, extra info, or facing unresolvable blockers",
"parameters": {"type": "object", "properties": {
"question": {"type": "string", "description": "Question for the user"},
"candidates": {"type": "array", "items": {"type": "string"}, "description": "Optional quick-select choices for the user"}}, "required": ["question"]}
}},
{"type": "function", "function": {
"name": "start_long_term_update",
"description": "Start distilling long-term memory. Call when discovering info worth remembering (env facts/user prefs/lessons learned). Skip if memory already updated or in autonomous flow. Must call for tasks taking 15+ turns",
"parameters": {"type": "object", "properties": {}}}
}
]