Repository navigation
Description
Summary
Document custom tools in the CLI, added in inference-gateway/cli#1372 (issue inference-gateway/cli#1366). Users add tools written in any language with one YAML manifest per tool. infer runs the manifest's command with the call's arguments as JSON on stdin and returns its stdout. The CLI repo's docs/custom-tools.md and the runnable examples/tools are the source.
User-facing behaviour to cover:
-
Where tools load from.
- User tools:
~/.infer/tools/, ortools.custom_dir/INFER_TOOLS_CUSTOM_DIR. - Project tools: the working directory's
.infer/tools/and.agents/tools/. - They merge. On a name clash the project tool wins, and
.infer/tools/wins over.agents/tools/.
- User tools:
-
Manifest. The same format as the built-in tool manifests:
name, which must match the file name.description.parameters: a JSON Schema of type object.modesandrequire_approval.command: argv, run without a shell. A bare name is looked up onPATH. A path with a slash resolves against the manifest's directory.timeout: seconds, default 30.enabled.
Unknown fields are rejected. An invalid manifest is skipped with a warning in the logs.
-
How a call runs.
- The arguments are validated against
parameters. - They go to stdin as one JSON object.
- Exit 0 makes stdout the result. A non-zero exit returns stderr, or stdout, as the error.
- The process is killed on timeout or cancel (its whole process group on Linux and macOS).
- The output is capped by
tools.max_result_bytes.
- The arguments are validated against
-
Modes and approval.
modesdecides where the tool is offered. The default isstandard,autoandauto-with-judge, so the tool is hidden inplanandreadonly.- User tools follow their
require_approval, which defaults totools.safety.require_approval. - Project tools always need approval, whatever the manifest says and even in
readonlymode, except inautomode. !!Name(...)andinfer tools executecount as the user's approval.
-
Names. Custom tools get no prefix. A name that matches any built-in tool (even one config switches off, compared case-insensitively) or starts with
MCP_is rejected. -
Write protection. Write, Edit, MultiEdit and Delete refuse any path inside a tools directory, also through a symlink or another spelling of the path. This cannot be switched off. Bash in
automode is not covered. -
Security.
- Tools run with the user's permissions. The sandbox only restricts the built-in file tools.
- A project's
.infer/config.yamlis trusted like the user's own. It can settools.custom_dir.
-
~/.infer/tools/is unrelated to~/.infer/bin/tools/, whichinfer binariesowns.
Affected pages:
- New
cli-custom-tools.md, next tocli-skills.md. It carries the full guide, with a shell example and a single-binary Rust example, and links toexamples/toolsin the CLI repo. cli.md:- Key Features: add a Custom Tools bullet linking the new page.
- Tools & Capabilities -> Tool Categories: add a Custom row.
- Security Features: add that project tools always need approval and that tool directories are write-protected.
- Tool Configuration: add
infer config set tools.custom_dir <dir>. - Configuration Files: add
tools/(Project/user). - Essential Environment Variables: add
INFER_TOOLS_CUSTOM_DIR.
mcp.md: a short "Custom tools vs MCP" pointer to the new page.
Acceptance Criteria
-
cli-custom-tools.mdcovers where tools load from, the manifest, how a call runs, modes and approval (including that project tools always ask), names, write protection and security, with the shell and Rust examples. -
cli.mdmentions custom tools in Key Features, Tool Categories, Security Features, Tool Configuration, Configuration Files and the environment variables. -
mcp.mdlinks to the new page. - The pages match the CLI's
docs/custom-tools.mdas merged in feat(tools): allow registering custom tools in any language cli#1372.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(tools): allow registering custom tools in any language (#1372)
edenreich commentedon Sep 28, 2026
@claude Can you document this?
inference-gateway-maintainer commentedon Sep 28, 2026
Claude finished @edenreich's task in 3m 16s —— View job •
docs/issue-850-20260928-2009• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-850-20260928-2009?quick_pull=1&title=Issue%20%23850%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23850%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Documented custom tools in the CLI
docs/custom-tools.md, existing page style)cli-custom-tools.mdcli.mdsectionsmcp.mdlint:md,format:check,build- all pass)PR: #852
What landed
cli-custom-tools.md- load order and precedence (~/.infer/tools/ortools.custom_dir, project.infer/tools/then.agents/tools/), the manifest reference (name,description,parameters,modes,require_approval,commandresolution,timeout,enabled, unknown fields rejected), the call contract (validation, JSON on stdin, exit-code semantics, timeout/cancel process-group kill,tools.max_result_bytes), modes and approval including project tools always asking outsideautomode, name rules (no prefix, built-in andMCP_names rejected), tool-directory write protection, the security model, the shell and Rust examples,INFER_TOOLS_CUSTOM_DIR, and troubleshooting. Links toexamples/toolsin the CLI repo.cli.md- Key Features bullet, a Custom row in Tool Categories, two Security Features entries,tools.custom_dirin Tool Configuration, atools/row in Configuration Files,INFER_TOOLS_CUSTOM_DIRin the env vars.mcp.md- short "Custom tools vs MCP" section plus a Learn More link.One wording change from the source doc: the
nameregex is spelled out in prose instead of inline, because markdownlint reads the bracketed pattern in a table cell as an undefined reference link.| Branch
inference-gateway-releaser commentedon Sep 30, 2026
🎉 This issue has been resolved in version 0.9.19 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀