{
"status": {
"type": "object",
"properties": {},
"additionalProperties": false
},
"bash": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"command": {
"description": "Shell command to execute. Supports pipes, redirection, and normal shell syntax.",
"type": "string"
},
"timeout": {
"description": "Hard kill cap in milliseconds (positive integer). When omitted, the task can run up to 30 minutes. Foreground bash returns inline if the command finishes within ~8s (configurable via bash.foreground_wait_window_ms); otherwise it's automatically promoted to background and a completion reminder is delivered when the task actually finishes.",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"workdir": {
"description": "Working directory for command execution. Relative paths resolve through the bridge; defaults to the current tool context/project root when omitted.",
"type": "string"
},
"description": {
"description": "Short 5-10 word human-readable summary shown in OpenCode UI metadata instead of raw shell syntax.",
"type": "string"
},
"background": {
"description": "When true, spawn the command in the background and return a taskId for bash_status/bash_kill instead of waiting for completion. Defaults to false.",
"type": "boolean"
},
"compressed": {
"description": "When true or omitted, return compressed output with noisy terminal control sequences reduced. Set to false for raw output.",
"type": "boolean"
},
"pty": {
"description": "When true, spawn the command in a real PTY for interactive programs (python/node/bash REPLs, vim). Implies background: true automatically. Unavailable in subagent sessions. Inspect with bash_status({ taskId, outputMode: \"screen\" }) and drive interactively with bash_write — its input accepts either a string OR an array like [ \"iHello\", { key: \"esc\" }, \":wq\", { key: \"enter\" } ] for atomic text+key sequences.",
"type": "boolean"
},
"ptyRows": {
"description": "PTY terminal height in rows — ignored when pty is false. Defaults to 24 when pty: true. Minimum 1, maximum 60.",
"type": "integer",
"minimum": 1,
"maximum": 60
},
"ptyCols": {
"description": "PTY terminal width in columns — ignored when pty is false. Defaults to 80 when pty: true. Minimum 1, maximum 140.",
"type": "integer",
"minimum": 1,
"maximum": 140
},
"foreground_orchestrate": {
"type": "boolean",
"description": "Consumer-set flag enabling server-side foreground orchestration."
},
"block_to_completion": {
"type": "boolean",
"description": "Consumer-set flag forcing foreground bash to wait until terminal instead of promoting."
}
},
"required": [
"command"
]
},
"read": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filePath": {
"description": "Path to file or directory (absolute or relative to project root)",
"type": "string"
},
"startLine": {
"description": "1-based line to start reading from",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"endLine": {
"description": "1-based line to stop reading at (inclusive)",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"limit": {
"description": "Max lines to return (default: 2000)",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"offset": {
"description": "1-based line number to start reading from (use with limit). Ignored if startLine is provided",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"filePath"
]
},
"write": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filePath": {
"description": "Path to the file to write (absolute or relative to project root)",
"type": "string"
},
"content": {
"description": "The full content to write to the file",
"type": "string"
}
},
"required": [
"filePath",
"content"
]
},
"edit": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filePath": {
"description": "Path to the file to edit (absolute or relative to project root)",
"type": "string"
},
"oldString": {
"description": "Text to find (exact match, with fuzzy fallback)",
"type": "string"
},
"newString": {
"description": "Text to replace with (omit or set to empty string to delete the matched text)",
"type": "string"
},
"replaceAll": {
"description": "Replace all occurrences",
"type": "boolean"
},
"occurrence": {
"description": "0-indexed occurrence to replace when multiple matches exist",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"symbol": {
"description": "Named symbol to replace (function, class, type)",
"type": "string"
},
"content": {
"description": "Replacement content for symbol mode. For whole-file writes, use the `write` tool.",
"type": "string"
},
"appendContent": {
"description": "Text to append to the end of filePath; creates the file if needed",
"type": "string"
},
"edits": {
"description": "Batch edits — array of { oldString: string, newString: string } or { startLine: number (1-based), endLine: number (1-based, inclusive), content: string }",
"type": "array",
"items": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
}
}
},
"apply_patch": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"patchText": {
"description": "The full patch text including Begin/End markers",
"type": "string"
}
},
"required": [
"patchText"
]
},
"grep": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"pattern": {
"type": "string"
},
"include": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"pattern"
]
},
"glob": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"pattern": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"pattern"
]
},
"search": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"query": {
"description": "Concept, regex, literal text, filename, or capability to find. Examples: 'fuzzy match with whitespace tolerance', '^export', 'Cargo.lock'.",
"type": "string"
},
"topK": {
"description": "Number of results (default: 10, max: 100)",
"type": "integer",
"minimum": 1,
"maximum": 100
},
"hint": {
"description": "Optional routing hint. Defaults to 'auto'.",
"type": "string",
"enum": [
"regex",
"literal",
"semantic",
"auto"
]
},
"includeTests": {
"description": "Include test files (*.test.*, *_test.rs, __tests__/, …) plus test-support, fixture, mock, snapshot, and corpus files. Defaults to false.",
"type": "boolean"
}
},
"required": [
"query"
]
},
"outline": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"target": {
"description": "What to outline: a file path, directory path, URL, or array of paths. The mode is auto-detected: URLs by `http://`/`https://` prefix, directories by stat, arrays as multi-file.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"files": {
"description": "Directory-only mode: when true, target must be a directory or array of directories and the result is a flat file tree with path, language, symbol count, and byte size instead of a symbol outline.",
"type": "boolean"
},
"includeTests": {
"description": "Directory outline only: include test files. Defaults to false; tests are hidden.",
"type": "boolean"
}
},
"required": [
"target"
]
},
"zoom": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filePath": {
"description": "Path to file (absolute or relative to project root)",
"type": "string"
},
"url": {
"description": "HTTP/HTTPS URL of an HTML or Markdown document to fetch and zoom into",
"type": "string"
},
"symbols": {
"description": "Symbol name for code, or heading text for Markdown/HTML. Pass a string for one lookup or an array for batched lookups in the same file/URL.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"targets": {
"description": "Cross-file batch: `{ filePath, symbol }` or an array of them. Mutually exclusive with filePath/url/symbols.",
"anyOf": [
{
"type": "object",
"properties": {
"filePath": {
"description": "Path to file (absolute or relative to project root)",
"type": "string"
},
"symbol": {
"description": "Symbol name in that file",
"type": "string"
}
},
"required": [
"filePath",
"symbol"
]
},
{
"type": "array",
"items": {
"type": "object",
"properties": {
"filePath": {
"description": "Path to file (absolute or relative to project root)",
"type": "string"
},
"symbol": {
"description": "Symbol name in that file",
"type": "string"
}
},
"required": [
"filePath",
"symbol"
]
}
}
]
},
"contextLines": {
"description": "Lines of context before/after the symbol (default: 3)",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"callgraph": {
"description": "Include call-graph annotations (calls-out / called-by within the same file). Default false; off keeps zoom output minimal.",
"type": "boolean"
}
}
},
"inspect": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"sections": {
"description": "Categories to include in detailed drill-down (e.g. 'todos' or ['todos', 'dead_code']). Use 'all' for every active category. Omit for summary-only mode.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"scope": {
"description": "Restrict scan/results to paths under this scope (file or directory, absolute or relative to project root). Tier 1 scopes the scan; Tier 2 scans project-wide and applies scope as a result filter.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"topK": {
"description": "Max drill-down items per category. Default 20, max 100.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 100
}
}
},
"callgraph": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"op": {
"description": "Navigation operation",
"type": "string",
"enum": [
"call_tree",
"callers",
"trace_to",
"trace_to_symbol",
"impact",
"trace_data"
]
},
"filePath": {
"description": "Path to the source file containing the symbol (absolute or relative to project root)",
"type": "string"
},
"symbol": {
"description": "Name of the symbol to analyze",
"type": "string"
},
"depth": {
"description": "Max traversal depth (default: call_tree=5, callers=1, trace_to=10, trace_to_symbol=10 capped at 16, impact=5, trace_data=5)",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"expression": {
"description": "Expression to track through data flow (required for trace_data op)",
"type": "string"
},
"toSymbol": {
"description": "Target symbol name for trace_to_symbol; the returned path ends at this symbol",
"type": "string"
},
"toFile": {
"description": "Optional target file for trace_to_symbol; required when toSymbol exists in multiple files",
"type": "string"
},
"includeTests": {
"description": "Include test files in callers/paths. Defaults to false; tests are hidden.",
"type": "boolean"
},
"includeUnresolved": {
"description": "Show every unresolved external/stdlib call individually. Defaults to false; unresolved leaf calls are collapsed into one summary per parent.",
"type": "boolean"
}
},
"required": [
"op",
"filePath",
"symbol"
]
},
"conflicts": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"path": {
"description": "Optional path inside the git repository or worktree to inspect (absolute or relative to project root). Conflicts are discovered from that repository's top level. Defaults to the session project root.",
"type": "string"
}
}
},
"ast_search": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"pattern": {
"description": "AST pattern with meta-variables ($VAR, $$$). Must be complete AST node.",
"type": "string"
},
"lang": {
"description": "Target language",
"type": "string",
"enum": [
"typescript",
"tsx",
"javascript",
"python",
"rust",
"go",
"pascal",
"r"
]
},
"paths": {
"description": "Paths to search (default: ['.'])",
"type": "array",
"items": {
"type": "string"
}
},
"globs": {
"description": "Include/exclude globs (prefix ! to exclude)",
"type": "array",
"items": {
"type": "string"
}
},
"contextLines": {
"description": "Number of context lines to show around each match",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"pattern",
"lang"
]
},
"ast_replace": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"pattern": {
"description": "AST pattern with meta-variables ($VAR, $$$). Must be complete AST node.",
"type": "string"
},
"rewrite": {
"description": "Replacement pattern (can use $VAR from pattern)",
"type": "string"
},
"lang": {
"description": "Target language",
"type": "string",
"enum": [
"typescript",
"tsx",
"javascript",
"python",
"rust",
"go",
"pascal",
"r"
]
},
"paths": {
"description": "Paths to search (default: ['.'])",
"type": "array",
"items": {
"type": "string"
}
},
"globs": {
"description": "Include/exclude globs (prefix ! to exclude)",
"type": "array",
"items": {
"type": "string"
}
},
"dryRun": {
"description": "Preview changes without applying (default: false)",
"type": "boolean"
}
},
"required": [
"pattern",
"rewrite",
"lang"
]
},
"delete": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"files": {
"description": "Paths to delete (one or more). May include directories when recursive=true.",
"minItems": 1,
"type": "array",
"items": {
"type": "string"
}
},
"recursive": {
"description": "Required to delete a directory and its contents. Defaults to false; passing a directory without this returns an error.",
"type": "boolean"
}
},
"required": [
"files"
]
},
"move": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"filePath": {
"description": "Source file path to move (absolute or relative to project root)",
"type": "string"
},
"destination": {
"description": "Destination file path (absolute or relative to project root)",
"type": "string"
}
},
"required": [
"filePath",
"destination"
]
},
"import": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"op": {
"description": "Import operation",
"type": "string",
"enum": [
"add",
"remove",
"organize"
]
},
"filePath": {
"description": "Path to the file (absolute or relative to project root)",
"type": "string"
},
"module": {
"description": "Module path (required for add, remove — e.g. 'react', './utils', 'std::fmt')",
"type": "string"
},
"names": {
"description": "Named imports to add. Each entry uses the language's native named-import text, including per-name aliasing where the language uses `as` (e.g. ['useState', 'debounce as db'], Solidity ['ERC20', 'IERC20 as IToken']).",
"type": "array",
"items": {
"type": "string"
}
},
"defaultImport": {
"description": "Default import name, ES only (e.g. 'React')",
"type": "string"
},
"namespace": {
"description": "Namespace binding: `import * as ns from 'mod'` (ES), `import * as N from \"./X.sol\"` (Solidity).",
"type": "string"
},
"alias": {
"description": "Whole-module alias. Solidity: `import \"./X.sol\" as X` (module=path, alias=X).",
"type": "string"
},
"modifiers": {
"description": "Statement-level modifier tokens, language-validated: Java/C# 'static'; C# 'global'/'unsafe'; Java/Kotlin/Scala 'wildcard'; Swift '@testable'. Unsupported tokens for the file's language return a clear error.",
"type": "array",
"items": {
"type": "string"
}
},
"importKind": {
"description": "Symbol-kind-specific import: PHP 'function'/'const'; Swift 'struct'/'class'/'enum'/'protocol'/'func'; Scala 'given'.",
"type": "string"
},
"typeOnly": {
"description": "Type-only import (TS only, default: false)",
"type": "boolean"
},
"removeName": {
"description": "Named import to remove for 'remove' op; omit to remove entire import",
"type": "string"
},
"validate": {
"description": "Validation level: 'syntax' (default) or 'full'. Syntax = tree-sitter parse check only. Full = also runs LSP type-checking (slower, catches more errors)",
"type": "string",
"enum": [
"syntax",
"full"
]
}
},
"required": [
"op",
"filePath"
]
},
"refactor": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"op": {
"description": "Refactoring operation",
"type": "string",
"enum": [
"move",
"extract",
"inline"
]
},
"filePath": {
"description": "Path to the source file (absolute or relative to project root)",
"type": "string"
},
"symbol": {
"description": "Symbol name — required for 'move' and 'inline' ops",
"type": "string"
},
"destination": {
"description": "Target file path — required for 'move' op",
"type": "string"
},
"scope": {
"description": "Disambiguation scope for 'move' op — when multiple top-level symbols share the same name, specify the containing scope to disambiguate (e.g. 'MyClass'). Does NOT enable access to nested symbols or class methods.",
"type": "string"
},
"name": {
"description": "New function name — required for 'extract' op",
"type": "string"
},
"startLine": {
"description": "1-based start line — required for 'extract' op",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"endLine": {
"description": "1-based end line (inclusive) — required for 'extract' op",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
},
"callSiteLine": {
"description": "1-based call site line — required for 'inline' op",
"type": "integer",
"minimum": 1,
"maximum": 9007199254740991
}
},
"required": [
"op",
"filePath"
]
},
"safety": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"op": {
"description": "Safety operation",
"type": "string",
"enum": [
"undo",
"history",
"checkpoint",
"restore",
"list"
]
},
"filePath": {
"description": "File path (required for history, optional for undo). Absolute or relative to project root",
"type": "string"
},
"name": {
"description": "Checkpoint name (required for checkpoint, restore)",
"type": "string"
},
"files": {
"description": "Specific files to include in checkpoint (optional, defaults to all tracked files)",
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"op"
]
}
}