Skip to main content

Module custom_tool

Module custom_tool 

Source
Expand description

Custom tool loaded from .opendev/tools/ directory.

Users can define custom tools by placing a JSON manifest file alongside an executable script in .opendev/tools/ (or .opencode/tool/).

§Manifest format (<name>.tool.json)

{
  "name": "github_triage",
  "description": "Assign and label GitHub issues",
  "command": "./github-triage.sh",
  "parameters": {
    "type": "object",
    "properties": {
      "issue": { "type": "string", "description": "Issue number" }
    },
    "required": ["issue"]
  },
  "timeout_secs": 30
}

The tool receives arguments as JSON on stdin and should write its result to stdout. Exit code 0 = success, non-zero = failure.

Structs§

CustomTool
A tool backed by an external script/executable.
CustomToolManifest
JSON manifest describing a custom tool.

Functions§

discover_custom_tools
Discover custom tools from standard directories.