Skip to content

feat(decopilot): add tool_search built-in tool#2453

Open
tlgimenes wants to merge 4 commits intomainfrom
feat/builtin-tool
Open

feat(decopilot): add tool_search built-in tool#2453
tlgimenes wants to merge 4 commits intomainfrom
feat/builtin-tool

Conversation

@tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented Feb 14, 2026

What is this contribution about?

Implements tool_search, a new built-in tool for decopilot agents to discover available tools in their current execution context.

Key features:

  • Simple server-side tool that queries the MCP client's listTools() method
  • Optional query parameter for substring filtering on tool names and descriptions
  • Returns tool metadata (name, description) with total count
  • Includes tool annotations (readOnlyHint, destructiveHint, etc.) and latency tracking
  • ~100 lines of implementation following the simplified architecture (no over-engineering)

Technical approach:

  • Reuses the already-created mcpClient from the conversation flow
  • Added mcpClient parameter to getBuiltInTools() function
  • Follows existing patterns from agent_search and subtask built-in tools
  • Full test coverage with 6 unit tests

This addresses the need for agents to introspect their available toolset before attempting to call tools.

Screenshots/Demonstration

N/A - This is a backend tool with no UI changes.

How to Test

1. Run Unit Tests

bun test apps/mesh/src/api/routes/decopilot/built-in-tools/tool-search.test.ts

Expected: All 6 tests pass ✓

2. Test Tool Registration

bun test apps/mesh/src/api/routes/decopilot/built-in-tools/registration.test.ts

Expected: Tests pass, confirming tool_search is registered in getBuiltInTools()

3. Test in Decopilot Conversation (Manual)

  1. Start the mesh server: bun run dev
  2. Create or open a decopilot conversation with a Virtual MCP agent
  3. Call the tool_search tool:
    • Without query: tool_search() - returns all available tools
    • With query: tool_search({ query: "slack" }) - returns tools matching "slack"
  4. Verify the response includes:
    • tools array with name and description fields
    • totalFound count
    • Tool metadata annotations in the stream

4. Verify Type Safety

bun run check

Expected: No TypeScript errors

Migration Notes

N/A - No database migrations or configuration changes required.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working (72 tests passing)
  • Documentation is updated (inline code comments and test descriptions)
  • No breaking changes (backward compatible - existing tools unaffected)

Summary by cubic

Adds tool_search, a built-in tool that lets decopilot agents discover and filter available tools from the MCP client. Also updates planning/review skills with clearer names and a streamlined workflow.

  • New Features

    • tool_search: server-side tool querying mcpClient.listTools() with optional substring filter (name/description).
    • Returns tool metadata (name, description) and totalFound; emits annotations and latency.
    • getBuiltInTools now accepts mcpClient; routes pass it through.
    • Tests added (unit + registration) to cover filtering, metadata, and integration.
  • Refactors

    • Renamed plan-critique → review-plan and review-critique → review-pr; updated references.
    • Removed plan-with-critique; added plan skill that automatically runs review-plan after creating a plan.

Written for commit 9b2b108. Summary will update on new commits.

tlgimenes and others added 4 commits February 13, 2026 19:38
…ique to review-pr

- Rename skill directories for clearer naming
- Update skill names, descriptions, and internal references
- Update plan-with-critique to reference review-plan

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Creates implementation plans using subagent and automatically runs
review-plan skill for multi-perspective critique and improvement.

Workflow:
- Spawn planning subagent to write plan to /plans/<name>.plan.md
- Automatically invoke review-plan for critique
- Enforces critique step with red flags and rationalization table

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implement tool_search built-in tool that allows agents to discover
available tools in their current context. The tool queries the MCP
client's listTools() method and returns tool names and descriptions
with optional query filtering.

Implementation details:
- Simple server-side tool that reuses existing mcpClient
- Optional query parameter for substring filtering
- Returns tool metadata (name, description)
- Includes annotations (readOnlyHint, etc.) and latency tracking
- Full test coverage with 6 unit tests

Technical changes:
- Add createToolSearchTool() function and schemas
- Update getBuiltInTools() to accept mcpClient parameter
- Pass mcpClient from routes.ts to built-in tools
- Update test files to include mock mcpClient

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

🧪 Benchmark

Should we run the Virtual MCP strategy benchmark for this PR?

React with 👍 to run the benchmark.

Reaction Action
👍 Run quick benchmark (10 & 128 tools)

Benchmark will run on the next push after you react.

@github-actions
Copy link
Contributor

Release Options

Should a new version be published when this PR is merged?

React with an emoji to vote on the release type:

Reaction Type Next Version
👍 Prerelease 2.98.1-alpha.1
🎉 Patch 2.98.1
❤️ Minor 2.99.0
🚀 Major 3.0.0

Current version: 2.98.0

Deployment

  • Deploy to production (triggers ArgoCD sync after Docker image is published)

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 12 files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant