Repository navigation
refactor(mcp): classify traced tool args from a rules file - #1412
Aaron ("AJ") Steers (aaronsteers) wants to merge 5 commits into
Conversation
Co-Authored-By: AJ Steers <aj@airbyte.io>
Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792462628-arg-trace-rules' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1792462628-arg-trace-rules'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
Code coverage overviewLanguages: Python Python / code-coverage/pytest-no-creds
View coverage of the 10 most impacted files.
Python / code-coverage/pytest
View coverage of the 10 most impacted files.
Python / code-coverage/pytest-unit
Line coverage data for the release-candidate/v1 branch is not yet available. View coverage of the 10 most covered files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. Updated |
Co-Authored-By: AJ Steers <aj@airbyte.io>
This reverts commit 3a36ba4.
There was a problem hiding this comment.
🟡 Changes recommended
The direct Git dependency blocks PyPI publishing and needs replacement with a released version range.
1 open issue
What changed in this PR
Centralizes MCP argument-tracing classifications in YAML shared by the OpenTelemetry and Datadog backends.
Changes:
- Replaces tool-signature markers with ordered tracing rules.
- Replaces the committed trace snapshot with plan generation and classification checks.
- Updates packaging and contributor guidance.
| File | Description |
|---|---|
uv.lock |
Locks the rules-capable Git dependency. |
tests/unit_tests/test_mcp_arg_trace_parity.py |
Checks rule coverage and backend parity. |
tests/unit_tests/fixtures/arg_trace_plan.json |
Removes the committed snapshot. |
pyproject.toml |
Updates dependency, YAML packaging, and generation task. |
airbyte/mcp/registry.py |
Removes tracing markers. |
airbyte/mcp/local.py |
Removes tracing markers. |
airbyte/mcp/interactive/_workspace_sync_status_ui.py |
Removes workspace tracing marker. |
airbyte/mcp/interactive/_sync_history_ui.py |
Removes workspace tracing marker. |
airbyte/mcp/interactive/_registry_ui.py |
Removes tracing markers. |
airbyte/mcp/guidance.py |
Removes tracing markers. |
airbyte/mcp/cloud.py |
Removes tracing markers. |
airbyte/mcp/arg_trace_rules.yaml |
Defines shared classification rules. |
airbyte/mcp/_trace_plan.py |
Generates the plan with classification sources. |
airbyte/mcp/_otel.py |
Supplies rules to OpenTelemetry tracing. |
airbyte/mcp/_datadog.py |
Supplies rules to Datadog tracing. |
airbyte/mcp/_arg_trace_rules.py |
Loads the YAML rules. |
AGENTS.md |
Documents rule maintenance. |
.gitignore |
Ignores the generated plan. |
Review effort: Balanced
| "fastmcp>=4.0.9,<5.0", | ||
| "fastmcp-extensions>=0.35.0,<1.0.0", | ||
| # TK-TODO: Restore fastmcp-extensions>=<next release>,<1.0.0 after the rules release. | ||
| "fastmcp-extensions @ git+https://github.com/airbytehq/fastmcp-extensions.git@devin/1792462457-arg-trace-rules", |
There was a problem hiding this comment.
Agreed. This is intentional while airbytehq/fastmcp-extensions#151 is unreleased, and the # TK-TODO marker makes the "Check for TK-TODO markers" job fail, which blocks merging until it's swapped. Once #151 ships, this line goes back to fastmcp-extensions>=<that release>,<1.0.0 and uv lock gets re-run. I'm leaving this thread open until then.
…78d1f6961ac33335777557b5 Co-Authored-By: AJ Steers <aj@airbyte.io>

Summary
MCP tool-argument trace classes now come from one rules file,
airbyte/mcp/arg_trace_rules.yaml, instead ofTraceArgmarkers on each tool signature plus a hand-regenerated JSON snapshot. Requested by Aaron ("AJ") Steers (@aaronsteers) in #1392 (comment) (option 2). Depends on airbytehq/fastmcp-extensions#151.arg_trace_rules.yamlholds ordered name globs (*_id: hash,*_name: fingerprint,workspace_id: omit), plustool:argkeys for real exceptions (get_stream_previews:streams). It's loaded by_arg_trace_rules.pyand passed to both tracers:ToolTracingConfig(arg_rules=...)in_otel.pyandArgTracer(rules=...)in_datadog.py.TraceArgmarkers are removed fromairbyte/mcp/**.tests/unit_tests/fixtures/arg_trace_plan.jsonis deleted.poe mcp-arg-trace-planwrites the full plan, with what decided each arg, to the gitignoredarg_trace_plan.json.test_every_arg_is_classified_by_a_rulefails when an arg falls to the type default or carries a marker, and says to add a rule to the YAML.test_no_dead_rulesfails when a rule matches nothing.test_datadog_and_otel_classification_agreenow covers each tool's full declared params, including theintentskip.## MCP Argument Tracingsection.bool/Literal/Enumargs are still recorded as values, and dict/model args as presence, without a rule. A rule overrides the secret-name heuristic:defer_credentials: value.Evidence
test_mcp_arg_trace_parity.py,test_mcp_datadog.py,test_mcp_otel.pyintentskipairbyte/mcp/arg_trace_rules.yamlBefore merge
pyproject.tomlpinsfastmcp-extensionsto the Move vector db destinations: Chroma, Astra, qdrant, to Poetry #151 git branch (# TK-TODO). Restore a version range once Move vector db destinations: Chroma, Astra, qdrant, to Poetry #151 is released.Link to Devin session: https://app.devin.ai/sessions/4d1ece6885c44c52a07034e025db11e6
Open in Devin Desktop: https://app.devin.ai/desktop/session/4d1ece6885c44c52a07034e025db11e6?variant=devin