GPT-5 Tools Definition

Below is the JSON schema describing all functions/tools exposed to the GPT-5 agent.

Tools Definition
{
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "view",
        "description": "View a file or directory. For files, optionally search within the file using a regex pattern or limit to a line range. Exclude the 'electron' folder by default unless explicitly requested.",
        "parameters": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": ["file", "directory"],
              "description": "Whether to view a single file or a directory listing (up to 2 levels)."
            },
            "path": {
              "type": "string",
              "description": "Path relative to the repository root."
            },
            "view_range": {
              "type": "array",
              "items": { "type": "integer" },
              "minItems": 2,
              "maxItems": 2,
              "description": "Optional [start_line, end_line] 1-based inclusive range for files."
            },
            "search_query_regex": {
              "type": "string",
              "description": "Optional regex to search within file content (single-line regex)."
            },
            "case_sensitive": {
              "type": "boolean",
              "default": false,
              "description": "Whether the regex search is case-sensitive."
            },
            "context_lines_before": {
              "type": "integer",
              "default": 5,
              "description": "Lines of context to include before each regex match."
            },
            "context_lines_after": {
              "type": "integer",
              "default": 5,
              "description": "Lines of context to include after each regex match."
            }
          },
          "required": ["type", "path"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "grep-search",
        "description": "Search across multiple files/directories or the whole codebase. Use for finding text/symbols across many files. Excludes 'electron/**' by default unless explicitly overridden.",
        "parameters": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "description": "Text or regex to search for."
            },
            "paths": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Optional list of directories or files to limit the search scope."
            },
            "include_globs": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Optional glob patterns to include (e.g., 'src/**/*.ts')."
            },
            "exclude_globs": {
              "type": "array",
              "items": { "type": "string" },
              "default": ["electron/**"],
              "description": "Optional glob patterns to exclude. Defaults to excluding the 'electron' folder."
            },
            "case_sensitive": {
              "type": "boolean",
              "default": false,
              "description": "Case sensitivity for the search."
            },
            "context_lines_before": {
              "type": "integer",
              "default": 5,
              "description": "Lines of context before each match."
            },
            "context_lines_after": {
              "type": "integer",
              "default": 5,
              "description": "Lines of context after each match."
            },
            "max_results": {
              "type": "integer",
              "default": 5000,
              "description": "Limit the number of matches returned."
            }
          },
          "required": ["query"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "codebase-retrieval",
        "description": "High-level retrieval across the current codebase to locate relevant files, classes, functions, or patterns when you don't know where to look.",
        "parameters": {
          "type": "object",
          "properties": {
            "information_request": {
              "type": "string",
              "description": "Natural-language description of what you need to find."
            }
          },
          "required": ["information_request"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "git-commit-retrieval",
        "description": "Use the repository’s commit history to find how similar changes were made in the past or why changes happened.",
        "parameters": {
          "type": "object",
          "properties": {
            "information_request": {
              "type": "string",
              "description": "Question about past changes (e.g., how/why a feature was implemented)."
            }
          },
          "required": ["information_request"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "str-replace-editor",
        "description": "Edit existing files safely. Use 'str_replace' for in-place replacements with explicit line ranges, or 'insert' to insert new content at a specific line.",
        "parameters": {
          "type": "object",
          "properties": {
            "command": {
              "type": "string",
              "enum": ["str_replace", "insert"],
              "description": "Edit mode: 'str_replace' or 'insert'."
            },
            "path": {
              "type": "string",
              "description": "Path of the file to edit, relative to repo root."
            },
            "instruction_reminder": {
              "type": "string",
              "description": "Must be exactly: 'ALWAYS BREAK DOWN EDITS INTO SMALLER CHUNKS OF AT MOST 150 LINES EACH.'"
            },
            "insert_line_1": {
              "type": "integer",
              "description": "For 'insert': 1-based line number after which to insert. Use 0 to insert at the very beginning."
            },
            "new_str_1": {
              "type": "string",
              "description": "For 'str_replace' and 'insert': the new content."
            },
            "old_str_1": {
              "type": "string",
              "description": "For 'str_replace': the exact original text to replace (must match exactly, including whitespace)."
            },
            "old_str_start_line_number_1": {
              "type": "integer",
              "description": "For 'str_replace': 1-based start line of old_str_1."
            },
            "old_str_end_line_number_1": {
              "type": "integer",
              "description": "For 'str_replace': 1-based end line of old_str_1 (inclusive)."
            }
          },
          "required": ["command", "path", "instruction_reminder"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "save-file",
        "description": "Create a new file. Does not modify existing files.",
        "parameters": {
          "type": "object",
          "properties": {
            "instructions_reminder": {
              "type": "string",
              "description": "Must be exactly: 'LIMIT THE FILE CONTENT TO AT MOST 300 LINES. IF MORE CONTENT NEEDS TO BE ADDED USE THE str-replace-editor TOOL TO EDIT THE FILE AFTER IT HAS BEEN CREATED.'"
            },
            "path": {
              "type": "string",
              "description": "Path for the new file, relative to repo root."
            },
            "file_content": {
              "type": "string",
              "description": "Content to write into the new file."
            },
            "add_last_line_newline": {
              "type": "boolean",
              "default": true,
              "description": "Whether to ensure a trailing newline."
            }
          },
          "required": ["instructions_reminder", "path", "file_content"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "remove-files",
        "description": "Delete files from the workspace in a reversible way.",
        "parameters": {
          "type": "object",
          "properties": {
            "file_paths": {
              "type": "array",
              "items": { "type": "string" },
              "description": "List of file paths to remove, relative to repo root."
            }
          },
          "required": ["file_paths"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "launch-process",
        "description": "Run a shell command. Use wait=true for short commands. OS is win32; shell is 'bash'.",
        "parameters": {
          "type": "object",
          "properties": {
            "command": { "type": "string", "description": "The shell command to execute." },
            "wait": { "type": "boolean", "description": "Whether to wait for the process to complete." },
            "max_wait_seconds": { "type": "integer", "description": "Timeout in seconds when wait=true." },
            "cwd": { "type": "string", "description": "Absolute working directory for the command." }
          },
          "required": ["command", "wait", "max_wait_seconds", "cwd"],
          "additionalProperties": false
        }
      }
    },
    { "type": "function", "function": {
      "name": "read-process",
      "description": "Read output from a previously launched process.",
      "parameters": {
        "type": "object",
        "properties": {
          "terminal_id": { "type": "integer", "description": "Target terminal ID." },
          "wait": { "type": "boolean", "description": "Whether to wait for completion." },
          "max_wait_seconds": { "type": "integer", "description": "Timeout when wait=true." }
        },
        "required": ["terminal_id", "wait", "max_wait_seconds"],
        "additionalProperties": false
      }
    }},
    { "type": "function", "function": {
      "name": "write-process",
      "description": "Write input to a running process’s stdin.",
      "parameters": {
        "type": "object",
        "properties": {
          "terminal_id": { "type": "integer", "description": "Target terminal ID." },
          "input_text": { "type": "string", "description": "Text to write to stdin." }
        },
        "required": ["terminal_id", "input_text"],
        "additionalProperties": false
      }
    }},
    { "type": "function", "function": {
      "name": "kill-process",
      "description": "Kill a running process by terminal ID.",
      "parameters": {
        "type": "object",
        "properties": {
          "terminal_id": { "type": "integer", "description": "Target terminal ID." }
        },
        "required": ["terminal_id"],
        "additionalProperties": false
      }
    }},
    { "type": "function", "function": {
      "name": "list-processes",
      "description": "List all known terminals created with the launch-process tool.",
      "parameters": { "type": "object", "properties": {}, "additionalProperties": false }
    }},
    {
      "type": "function",
      "function": {
        "name": "diagnostics",
        "description": "Return IDE issues (errors, warnings, etc.) for specified files.",
        "parameters": {
          "type": "object",
          "properties": {
            "paths": {
              "type": "array",
              "items": { "type": "string" },
              "description": "List of file paths to get issues for."
            }
          },
          "required": ["paths"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "read-terminal",
        "description": "Read the visible output from the active or most-recently used VSCode terminal.",
        "parameters": {
          "type": "object",
          "properties": {
            "only_selected": {
              "type": "boolean",
              "description": "Whether to read only the selected text."
            }
          },
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "open-browser",
        "description": "Open a URL in the default browser.",
        "parameters": {
          "type": "object",
          "properties": {
            "url": { "type": "string", "description": "URL to open." }
          },
          "required": ["url"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "web-search",
        "description": "Search the web using Google Custom Search API.",
        "parameters": {
          "type": "object",
          "properties": {
            "query": { "type": "string", "description": "Search query." },
            "num_results": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 5,
              "description": "Number of results to return (1–10)."
            }
          },
          "required": ["query"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "web-fetch",
        "description": "Fetch a webpage and return its content in Markdown format.",
        "parameters": {
          "type": "object",
          "properties": {
            "url": { "type": "string", "description": "URL to fetch." }
          },
          "required": ["url"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "view-range-untruncated",
        "description": "View a specific line range from previously truncated content by reference ID.",
        "parameters": {
          "type": "object",
          "properties": {
            "reference_id": { "type": "string", "description": "Reference ID from truncation footer." },
            "start_line": { "type": "integer", "description": "1-based inclusive start line." },
            "end_line": { "type": "integer", "description": "1-based inclusive end line." }
          },
          "required": ["reference_id", "start_line", "end_line"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "search-untruncated",
        "description": "Search within previously untruncated content by reference ID.",
        "parameters": {
          "type": "object",
          "properties": {
            "reference_id": { "type": "string", "description": "Reference ID from truncation footer." },
            "search_term": { "type": "string", "description": "Text to search for." },
            "context_lines": { "type": "integer", "default": 2, "description": "Context lines around matches." }
          },
          "required": ["reference_id", "search_term"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "view_tasklist",
        "description": "View the current task list for the conversation.",
        "parameters": { "type": "object", "properties": {}, "additionalProperties": false }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "add_tasks",
        "description": "Add one or more new tasks (and optional subtasks) to the task list.",
        "parameters": {
          "type": "object",
          "properties": {
            "tasks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "name": { "type": "string" },
                  "description": { "type": "string" },
                  "parent_task_id": { "type": "string" },
                  "after_task_id": { "type": "string" },
                  "state": {
                    "type": "string",
                    "enum": ["NOT_STARTED", "IN_PROGRESS", "CANCELLED", "COMPLETE"]
                  }
                },
                "required": ["name", "description"],
                "additionalProperties": false
              }
            }
          },
          "required": ["tasks"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "update_tasks",
        "description": "Update one or more tasks' properties (state, name, description). Prefer batch updates.",
        "parameters": {
          "type": "object",
          "properties": {
            "tasks": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "task_id": { "type": "string" },
                  "state": {
                    "type": "string",
                    "enum": ["NOT_STARTED", "IN_PROGRESS", "CANCELLED", "COMPLETE"]
                  },
                  "name": { "type": "string" },
                  "description": { "type": "string" }
                },
                "required": ["task_id"],
                "additionalProperties": false
              }
            }
          },
          "required": ["tasks"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "reorganize_tasklist",
        "description": "Major restructuring of the task list using a full markdown representation.",
        "parameters": {
          "type": "object",
          "properties": {
            "markdown": { "type": "string", "description": "Full task list in markdown with exactly one root task." }
          },
          "required": ["markdown"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "remember",
        "description": "Store long-term memory that can be useful in future interactions.",
        "parameters": {
          "type": "object",
          "properties": {
            "memory": { "type": "string", "description": "One concise sentence to remember." }
          },
          "required": ["memory"],
          "additionalProperties": false
        }
      }
    },
    {
      "type": "function",
      "function": {
        "name": "render-mermaid",
        "description": "Render a Mermaid diagram from the provided definition.",
        "parameters": {
          "type": "object",
          "properties": {
            "diagram_definition": { "type": "string", "description": "Mermaid definition code." },
            "title": { "type": "string", "description": "Optional title for the diagram." }
          },
          "required": ["diagram_definition"],
          "additionalProperties": false
        }
      }
    }
  ]
}