Files
agent/app/server/tools/definitions.json
T

237 lines
12 KiB
JSON

[
{
"type": "function",
"function": {
"name": "edit_file",
"description": "This is a tool for applying edits to an existing file.\n\nBefore using this tool, use the `read_file` tool to understand the file's contents and context.\nTo create a new file or overwrite an existing one with completely new contents, use the `write_file` tool instead.\n\nWhen copying text from `read_file` output into `old_text` or `new_text`, strip the line-number prefix and the tab after it, and keep the original indentation exactly.\n\nMatching rules:\n- `old_text` is first matched exactly. If there is no exact match, a fuzzy match tolerating minor whitespace and formatting differences is attempted.\n- If `old_text` matches more than one location (overlapping matches count as separate locations), the edit fails. Include enough surrounding context to make it unique; avoid very short or repetitive `old_text`.\n- If no match is found at all, the edit fails. For very large files the fuzzy stage degrades to per-line whitespace-insensitive exact matching; the error message says so — do not retry the same text, locate with `read_file` by line numbers or use `terminal` with sed.\n\nTo delete a whole line, set `old_text` to that line WITHOUT its trailing newline and `new_text` to an empty string. Otherwise a blank line will be left behind.\n\nEdits are applied in order. If one edit fails, the edits before it are already written to disk and the file has changed: the error message tells you how many were applied. You must call `read_file` again before retrying; do not reuse the previous `old_text` values.",
"parameters": {
"type": "object",
"required": ["path", "edits"],
"properties": {
"path": {
"type": "string",
"description": "Path of the file to edit, relative to the session working directory. Absolute paths are also accepted."
},
"edits": {
"type": "array",
"description": "List of edit operations to apply sequentially. Each edit finds `old_text` in the file and replaces it with `new_text`. If any edit fails, the edits before it remain applied.",
"items": {
"type": "object",
"required": ["old_text", "new_text"],
"properties": {
"old_text": {
"type": "string",
"description": "The text to find in the file. Matched exactly first, then fuzzily (whitespace / minor formatting differences tolerated). Provide enough context to make the match unique; short or repeated snippets are reported as ambiguous. A trailing newline, if present, is stripped before matching; for whole-line deletion omit it."
},
"new_text": {
"type": "string",
"description": "The replacement text. Use an empty string together with a trailing-newline-free `old_text` to delete a whole line."
}
}
}
}
}
}
}
},
{
"type": "function",
"function": {
"name": "fetch",
"description": "Fetches a URL and returns its content as Markdown. Only http and https are supported; if the scheme is omitted, https is assumed.\n\nHTML pages are converted to Markdown. JSON, XML, plain text, and Markdown responses are returned as-is. Binary responses are not returned — only their HTTP status, content-type, and size.\n\nThe response always starts with a line `HTTP <status>`, followed by the body. Check the status line: a non-2xx status means the fetch did not succeed, even if body content is present.\n\nRequests are subject to a timeout, and oversized responses are truncated. Redirects are followed automatically.",
"parameters": {
"type": "object",
"required": ["url"],
"properties": {
"url": {
"type": "string",
"description": "The URL to fetch. Must be http or https; if no scheme is given, https is assumed."
}
}
}
}
},
{
"type": "function",
"function": {
"name": "mint_public_link",
"description": "Create a short-lived, publicly reachable URL for a local file, so an external service that cannot authenticate can download it.\nUse this when another tool or API needs to fetch a local file by URL. Returns the URL as plain text on a single line.",
"parameters": {
"type": "object",
"required": ["path"],
"properties": {
"path": {
"type": "string",
"description": "Path of the file to publish, relative to the session working directory. Absolute paths inside the session working directory are also accepted."
}
}
}
}
},
{
"type": "function",
"function": {
"name": "read_file",
"description": "Reads the content of a file.\n\n- For large text files, this tool may return an outline with symbol names and line numbers instead of the full content. This outline IS a successful response; use the line numbers to read specific sections with `start_line` and `end_line`.\n- Do NOT retry reading the same file without line numbers if you receive an outline.\n- Supports reading image files (PNG, JPEG, WebP, GIF, BMP, TIFF) and returns them as visual content you can analyze directly.\n- When reading text files, each line in the returned content is prefixed with a right-aligned line number field and a tab. When extracting text for use in `edit_file`, remove this prefix and keep only the content after the tab, preserving original indentation.",
"parameters": {
"type": "object",
"required": ["path"],
"properties": {
"path": {
"type": "string",
"description": "Path of the file to read, relative to the session working directory. Absolute paths are also accepted."
},
"start_line": {
"type": "integer",
"nullable": true,
"description": "Optional line number to start reading from (1-based).",
"default": null,
"minimum": 1
},
"end_line": {
"type": "integer",
"nullable": true,
"description": "Optional line number to end reading at (1-based, inclusive).",
"default": null,
"minimum": 1
}
}
}
}
},
{
"type": "function",
"function": {
"name": "schedule_task",
"description": "Create a recurring scheduled task for the CURRENT session. At each trigger, the given prompt is sent to this session as a new user message. Only one task per session is allowed; if one already exists the call fails and the user must delete it first in the session view. Call this ONLY when the user explicitly asks for something to run periodically or at a specific time.",
"parameters": {
"type": "object",
"required": ["cron_expr", "prompt"],
"properties": {
"cron_expr": {
"type": "string",
"description": "Standard 5-field cron expression, e.g. '0 9 * * *' for 09:00 every day. Minimum interval is 1 hour."
},
"prompt": {
"type": "string",
"description": "The message to send to this session at each trigger. Write it as a self-contained instruction, because previous conversation history is archived before each run."
}
}
}
}
},
{
"type": "function",
"function": {
"name": "terminal",
"description": "Executes a shell one-liner and returns combined stdout/stderr output.\n\n- Run commands relative to the session working directory. Use the `cd` parameter to specify a different directory if needed.\n- Do not use shell substitutions or interpolations (e.g., `$VAR`, `${VAR}`, `$(...)`, backticks). Resolve values yourself first.\n- Do not pipe output to `head` or `tail`; use the `head_lines` and `tail_lines` parameters to limit what is returned while keeping full output visible to the user.\n- Avoid commands that run indefinitely (servers, watchers). For long-running commands, set `timeout_ms`.\n- Each invocation starts a new shell; do not rely on state from previous calls.\n- If a command may open a pager or editor, disable it using environment variables (e.g., `GIT_PAGER=cat`, `EDITOR=true`).",
"parameters": {
"type": "object",
"required": ["command"],
"properties": {
"command": {
"type": "string",
"description": "The shell one-liner to execute. Do not include shell substitutions; use literal values."
},
"cd": {
"type": "string",
"nullable": true,
"description": "Optional working directory for the command. If omitted, runs in the session working directory. Accepts relative or absolute path."
},
"timeout_ms": {
"type": "integer",
"nullable": true,
"description": "Optional maximum runtime in milliseconds. If exceeded, the process is killed.",
"minimum": 0
},
"head_lines": {
"type": "integer",
"nullable": true,
"description": "Return only the first N lines of output to the model. The user still sees full live output.",
"minimum": 0,
"default": null
},
"tail_lines": {
"type": "integer",
"nullable": true,
"description": "Return only the last N lines of output to the model. The user still sees full live output.",
"minimum": 0,
"default": null
}
}
}
}
},
{
"type": "function",
"function": {
"name": "write_file",
"description": "Creates a new file or overwrites an existing file with the given content.\n\nUse `edit_file` for targeted changes to existing files. Parent directories are created automatically as needed.",
"parameters": {
"type": "object",
"required": ["path", "content"],
"properties": {
"path": {
"type": "string",
"description": "Path of the file to create or overwrite, relative to the session working directory. Absolute paths are also accepted."
},
"content": {
"type": "string",
"description": "The entire content to write to the file."
}
}
}
}
},
{
"type": "function",
"function": {
"name": "list_skills",
"description": "Lists all available skills from the skill root directory, returning each skill's name and brief description.\n\nSkills are self-contained directories with a SKILL.md description and an executable entry point (run.py or run.sh). Use this tool to refresh or confirm the current list of available skills, then use get_skill_info for details or run_skill to execute.",
"parameters": {
"type": "object",
"required": [],
"properties": {}
}
}
},
{
"type": "function",
"function": {
"name": "get_skill_info",
"description": "Returns the full content of the SKILL.md file for a given skill, including its purpose, parameters (input_schema), and usage instructions.",
"parameters": {
"type": "object",
"required": ["skill_name"],
"properties": {
"skill_name": {
"type": "string",
"description": "Name of the skill (subdirectory name under the skill root directory)."
}
}
}
}
},
{
"type": "function",
"function": {
"name": "run_skill",
"description": "Executes a specified skill with the provided input arguments. The skill's entry script receives a JSON string as the only command-line argument.\n\n- Required parameters are validated against the skill's input_schema.\n- Default timeout is 120 seconds.\n- Relative paths in arguments are resolved against the session working directory; you may pass relative or absolute paths.",
"parameters": {
"type": "object",
"required": ["skill_name", "input_args"],
"properties": {
"skill_name": {
"type": "string",
"description": "Name of the skill to execute."
},
"input_args": {
"type": "object",
"description": "Dictionary of input arguments for the skill. Keys and values should match the skill's input_schema. Example: {\"input\": \"file.md\", \"output\": \"out.pdf\"}."
}
}
}
}
}
]