feat(code): /tools slash command - #4649
Merged
Merged
Conversation
Add an interactive `/tools` slash command to the `deepagents-code` TUI that lists the tools available to the agent, grouped by source (built-in tools first, then per-MCP-server tools) plus any MCP servers configured with no tools. It is the interactive counterpart to `dcode tools list`. Built-in tools are enumerated off the UI thread via `asyncio.to_thread`; MCP data reuses the already-loaded server info rather than re-discovering, since the discovery path uses `asyncio.run`, which cannot run inside Textual's live event loop. A shared `split_mcp_server_info` helper keeps the CLI and TUI paths DRY. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
marked this pull request as ready for review
July 12, 2026 00:13
Mason Daugherty (mdrxy)
added a commit
that referenced
this pull request
Jul 13, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.37](deepagents-code==0.1.36...deepagents-code==0.1.37) (2026-07-13) ### Features * Add Meta model provider ([#4650](#4650)) ([70829c5](70829c5)) * Set `prompt_cache_key` for OpenAI models ([#4632](#4632)) ([8cf57ac](8cf57ac)) * Support Fireworks `/routers` model ids ([#4591](#4591)) ([1c08d27](1c08d27)) * `/model` Ctrl+N toggle for names vs raw specs ([#4592](#4592)) ([518c322](518c322)) * `/tools` slash command ([#4649](#4649)) ([b1600a8](b1600a8)) * Add `-s` alias for `--skill` ([#4620](#4620)) ([c9b7ac2](c9b7ac2)) * Configurable chat cursor style ([#4687](#4687)) ([a22484b](a22484b)) * Expand environment variables in MCP config ([#4681](#4681)) ([4f5d7be](4f5d7be)) * Hide diff widget for credential files ([#4593](#4593)) ([4c49a24](4c49a24)) * In-app Debug Console ([#4564](#4564)) ([4f94a30](4f94a30)) * Offer abort in `/threads` cwd-switch prompt ([#4583](#4583)) ([aaeac99](aaeac99)) * Resume threads in-TUI with `/threads -r [ID]` ([#4609](#4609)) ([d442673](d442673)) * Show `(debug enabled)` on splash when `DEEPAGENTS_CODE_DEBUG` is set ([#4584](#4584)) ([f10b877](f10b877)) ### Bug Fixes * Avoid repeated startup auto-update stalls ([#4648](#4648)) ([12a9c9d](12a9c9d)) * Infer Fireworks provider from qualified model IDs ([#4594](#4594)) ([4d2aa8a](4d2aa8a)) * Capture input typed before TUI startup ([#4684](#4684)) ([ef9a4a8](ef9a4a8)) * Detach owned `langgraph dev` server from terminal ([#4642](#4642)) ([d1f3afe](d1f3afe)) * Infer additional model providers ([#4675](#4675)) ([4ceed24](4ceed24)) * Preserve `Ctrl+D` deletion in non-empty input ([#4626](#4626)) ([306bd89](306bd89)) * Quit with `Ctrl+D` at end of prompt ([#4678](#4678)) ([2f8c111](2f8c111)) * Reap langgraph dev server when startup is cancelled ([#4629](#4629)) ([904ff05](904ff05)) * Reject `--auto-approve` in headless mode ([#4617](#4617)) ([997be16](997be16)) * Route explicit `--stdin` + `--skill` to headless path ([#4611](#4611)) ([724e24a](724e24a)) * Skip Esc prompt-restore once output generation begins ([#4582](#4582)) ([14f384f](14f384f)) * Remove misleading agent names from help ([#4671](#4671)) ([ac15732](ac15732)) * Support plain `exit` quit command ([#4543](#4543)) ([e6f10a1](e6f10a1)) * Sync `ask_user` active-question highlight with focus ([#4599](#4599)) ([e4c29b5](e4c29b5)) * Wrap MCP viewer navigation ([#4677](#4677)) ([cffc732](cffc732)) ### Performance Improvements * Load MCP servers concurrently during graph build ([#4659](#4659)) ([c5345cc](c5345cc)) --- _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
Deep Agents Code now supports `/tools`, which lists the built-in and MCP tools available to the current agent. --- Adds an interactive `/tools` slash command to the `deepagents-code` TUI so users can see the tools available to the current agent, grouped into built-in tools and tools from each MCP server. MCP servers that are disabled, need login, or failed to load are shown separately instead of disappearing from the list. For managed sessions, built-in tools are enumerated off the UI thread with a credential-free agent compile. For preconfigured local agents, `/tools` inspects the active graph directly so custom tool sets remain authoritative. When a custom or remote agent cannot be inspected, the command explains that limitation rather than incorrectly reporting that no tools are available. MCP entries reuse the metadata loaded for the running agent instead of starting discovery inside Textual's live event loop. If `/mcp` configuration changes are waiting for a reconnect, `/tools` keeps using the pre-change snapshot so its output continues to match the tools the agent can currently invoke. The catalog is rendered as a chat message, like `/tokens`, and is discoverable through `/help`, command completion, and a startup tip. Made by [Open SWE](https://openswe.vercel.app/agents/626ca1ec-726e-58e8-7dae-4e85363c953d) ## References - Plan: https://openswe.vercel.app/agents/626ca1ec-726e-58e8-7dae-4e85363c953d/plan --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Marcelo5444
pushed a commit
to Marcelo5444/deepagents
that referenced
this pull request
Jul 30, 2026
> [!CAUTION] > Merging this PR will automatically publish to **PyPI** and create a **GitHub release**. For the full release process, see [`.github/RELEASING.md`](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md). --- _Release notes preview: keep this section in sync with the package `CHANGELOG.md`. The published GitHub release body is extracted from the merged `CHANGELOG.md` by `release.yml`, not from this PR description._ --- ## [0.1.37](langchain-ai/deepagents@deepagents-code==0.1.36...deepagents-code==0.1.37) (2026-07-13) ### Features * Add Meta model provider ([langchain-ai#4650](langchain-ai#4650)) ([70829c5](langchain-ai@70829c5)) * Set `prompt_cache_key` for OpenAI models ([langchain-ai#4632](langchain-ai#4632)) ([8cf57ac](langchain-ai@8cf57ac)) * Support Fireworks `/routers` model ids ([langchain-ai#4591](langchain-ai#4591)) ([1c08d27](langchain-ai@1c08d27)) * `/model` Ctrl+N toggle for names vs raw specs ([langchain-ai#4592](langchain-ai#4592)) ([518c322](langchain-ai@518c322)) * `/tools` slash command ([langchain-ai#4649](langchain-ai#4649)) ([b1600a8](langchain-ai@b1600a8)) * Add `-s` alias for `--skill` ([langchain-ai#4620](langchain-ai#4620)) ([c9b7ac2](langchain-ai@c9b7ac2)) * Configurable chat cursor style ([langchain-ai#4687](langchain-ai#4687)) ([a22484b](langchain-ai@a22484b)) * Expand environment variables in MCP config ([langchain-ai#4681](langchain-ai#4681)) ([4f5d7be](langchain-ai@4f5d7be)) * Hide diff widget for credential files ([langchain-ai#4593](langchain-ai#4593)) ([4c49a24](langchain-ai@4c49a24)) * In-app Debug Console ([langchain-ai#4564](langchain-ai#4564)) ([4f94a30](langchain-ai@4f94a30)) * Offer abort in `/threads` cwd-switch prompt ([langchain-ai#4583](langchain-ai#4583)) ([aaeac99](langchain-ai@aaeac99)) * Resume threads in-TUI with `/threads -r [ID]` ([langchain-ai#4609](langchain-ai#4609)) ([d442673](langchain-ai@d442673)) * Show `(debug enabled)` on splash when `DEEPAGENTS_CODE_DEBUG` is set ([langchain-ai#4584](langchain-ai#4584)) ([f10b877](langchain-ai@f10b877)) ### Bug Fixes * Avoid repeated startup auto-update stalls ([langchain-ai#4648](langchain-ai#4648)) ([12a9c9d](langchain-ai@12a9c9d)) * Infer Fireworks provider from qualified model IDs ([langchain-ai#4594](langchain-ai#4594)) ([4d2aa8a](langchain-ai@4d2aa8a)) * Capture input typed before TUI startup ([langchain-ai#4684](langchain-ai#4684)) ([ef9a4a8](langchain-ai@ef9a4a8)) * Detach owned `langgraph dev` server from terminal ([langchain-ai#4642](langchain-ai#4642)) ([d1f3afe](langchain-ai@d1f3afe)) * Infer additional model providers ([langchain-ai#4675](langchain-ai#4675)) ([4ceed24](langchain-ai@4ceed24)) * Preserve `Ctrl+D` deletion in non-empty input ([langchain-ai#4626](langchain-ai#4626)) ([306bd89](langchain-ai@306bd89)) * Quit with `Ctrl+D` at end of prompt ([langchain-ai#4678](langchain-ai#4678)) ([2f8c111](langchain-ai@2f8c111)) * Reap langgraph dev server when startup is cancelled ([langchain-ai#4629](langchain-ai#4629)) ([904ff05](langchain-ai@904ff05)) * Reject `--auto-approve` in headless mode ([langchain-ai#4617](langchain-ai#4617)) ([997be16](langchain-ai@997be16)) * Route explicit `--stdin` + `--skill` to headless path ([langchain-ai#4611](langchain-ai#4611)) ([724e24a](langchain-ai@724e24a)) * Skip Esc prompt-restore once output generation begins ([langchain-ai#4582](langchain-ai#4582)) ([14f384f](langchain-ai@14f384f)) * Remove misleading agent names from help ([langchain-ai#4671](langchain-ai#4671)) ([ac15732](langchain-ai@ac15732)) * Support plain `exit` quit command ([langchain-ai#4543](langchain-ai#4543)) ([e6f10a1](langchain-ai@e6f10a1)) * Sync `ask_user` active-question highlight with focus ([langchain-ai#4599](langchain-ai#4599)) ([e4c29b5](langchain-ai@e4c29b5)) * Wrap MCP viewer navigation ([langchain-ai#4677](langchain-ai#4677)) ([cffc732](langchain-ai@cffc732)) ### Performance Improvements * Load MCP servers concurrently during graph build ([langchain-ai#4659](langchain-ai#4659)) ([c5345cc](langchain-ai@c5345cc)) --- _End release notes preview._ --- > [!NOTE] > A **New Contributors** section is appended to the GitHub release notes automatically at publish time (see [Release Pipeline](https://github.com/langchain-ai/deepagents/blob/main/.github/RELEASING.md#release-pipeline), step 2). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mason Daugherty <github@mdrxy.com>
Mason Daugherty (mdrxy)
added a commit
to langchain-ai/docs
that referenced
this pull request
Aug 27, 2026
Document the /context-doctor, /tools, and /cost slash commands in the Deep Agents Code command workflow pages: - New 'Diagnose and audit a session' section in cli-reference.mdx with verified example output, /context and dcode doctor relationships, and version notes (0.1.62, 0.1.37, 0.1.51). - Slash-command list entries and a context-window usage pointer in quickstart.mdx. Refs langchain-ai/deepagents#5830, langchain-ai/deepagents#4649, langchain-ai/deepagents#5036. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Mason Daugherty (mdrxy)
added a commit
to langchain-ai/docs
that referenced
this pull request
Aug 27, 2026
## Summary Documents the Deep Agents Code diagnostic slash commands shipped in langchain-ai/deepagents#5830 (`/context-doctor`, 0.1.62), langchain-ai/deepagents#4649 (`/tools`, 0.1.37), and langchain-ai/deepagents#5036 (`/cost`, 0.1.51). - **`cli-reference.mdx`**: new "Diagnose and audit a session" section covering `/tools` (active tool set, unavailable MCP servers, tool-shaping flags), `/context-doctor` (injected-context audit, estimated tokens, unexpected growth, relationship to `/context` and `dcode doctor`), and `/cost` (estimated thread cost, checkpoint persistence, genai-prices source, display-only caveat). Each carries its minimum-version `<Note>`. - **`quickstart.mdx`**: slash-command list entries plus a pointer from "Inspect context-window usage"; refreshes `/clear` and `/force-clear` descriptions and current shortcuts (`Ctrl+G` editor, `Ctrl+T` subagent panel, `Shift+Tab` approval cycle). Example output was generated by exercising the real rendering code (`context_doctor.py`, `tool_catalog.py`, `_session_stats.py`) against the current source at langchain-ai/deepagents@9f3a1dd38; command names, descriptions, and visibility match `command_registry.py` and the generated `COMMANDS.md`. ## Verification - `vale` 3.9.6 (scoped `lint_prose` on both changed files): 0 errors, 0 warnings, 0 suggestions. - `mint broken-links` and `mint broken-links --check-anchors` on a fresh `pipeline build`: no broken links. - 241 related deepagents unit tests pass (`test_context_doctor.py`, `test_cost_tracking.py`, `test_command_registry.py`, `test_tool_catalog.py`). AI agent involvement: authored by Open SWE. ## Stack This is stack 3/4 and targets #5692 (`mdrxy/docs/dcode-approval-goals`). Made by [Open SWE](https://openswe.vercel.app/agents/90221b46-f65a-5c24-95e1-bb8ae62dadd9) --------- Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deep Agents Code now supports
/tools, which lists the built-in and MCP tools available to the current agent.Adds an interactive
/toolsslash command to thedeepagents-codeTUI so users can see the tools available to the current agent, grouped into built-in tools and tools from each MCP server. MCP servers that are disabled, need login, or failed to load are shown separately instead of disappearing from the list.For managed sessions, built-in tools are enumerated off the UI thread with a credential-free agent compile. For preconfigured local agents,
/toolsinspects the active graph directly so custom tool sets remain authoritative. When a custom or remote agent cannot be inspected, the command explains that limitation rather than incorrectly reporting that no tools are available.MCP entries reuse the metadata loaded for the running agent instead of starting discovery inside Textual's live event loop. If
/mcpconfiguration changes are waiting for a reconnect,/toolskeeps using the pre-change snapshot so its output continues to match the tools the agent can currently invoke.The catalog is rendered as a chat message, like
/tokens, and is discoverable through/help, command completion, and a startup tip.Made by Open SWE
References