Skip to content

fix(claude): MCP tools silently excluded from API requests#42

Merged
jrob5756 merged 4 commits intomainfrom
fix/claude-mcp-tool-filtering
Mar 16, 2026
Merged

fix(claude): MCP tools silently excluded from API requests#42
jrob5756 merged 4 commits intomainfrom
fix/claude-mcp-tool-filtering

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

Summary

Fixes two coupled bugs that completely prevented MCP tools from working with the Claude provider:

Before

Agent: "The read_file tool is not available in this environment. Only the emit_output tool is accessible."

After

{"content": "test file contents for issue 37 repro"}

Test plan

  • Unit tests for _convert_mcp_tools_to_claude filter behavior (7 tests)
  • Unit tests for _has_mcp_tool_use helper (5 tests)
  • Unit tests for _execute_with_parse_recovery MCP passthrough (3 tests)
  • Integration tests through full WorkflowEngineAgentExecutorClaudeProvider pipeline (4 tests)
  • Verified with live MCP filesystem server — agent reads /tmp/test.txt successfully
  • Full test suite passes (1685 passed, 0 failures)

Fixes #37
Fixes #38

🤖 Generated with Claude Code

Jason Robert and others added 4 commits March 16, 2026 18:31
Change truthiness check in _convert_mcp_tools_to_claude so that
tool_filter=[] (the default when no workflow tools are defined) is
treated as "no filter" rather than "filter to nothing".

Fixes #37

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_execute_with_parse_recovery treated MCP tool_use responses (e.g.
filesystem__read_file) as failed structured-output extraction and
entered a futile parse-recovery cycle instead of returning the
response to the agentic loop for tool execution.

Add _has_mcp_tool_use() helper and early-return checks in both the
initial response path and the recovery loop so non-emit_output
tool_use blocks pass through to the agentic loop.

Fixes #38

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unused imports (Mock, patch), unused variable
(original_agentic_loop), fix import sorting, and use specific
ProviderError instead of bare Exception in pytest.raises.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrob5756 jrob5756 merged commit f2019d4 into main Mar 16, 2026
7 checks passed
@jrob5756 jrob5756 deleted the fix/claude-mcp-tool-filtering branch March 17, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant