Skip to content

Conversation

@jboolean
Copy link
Contributor

@jboolean jboolean commented Nov 20, 2025

What does this PR do?

Fix for spans not marked as errors for tool calls that resulted in an error response.

mcp-go has two ways for a tool to return an error as documented here: https://mcp-go.dev/servers/tools#error-results

We were not handling the "structured error information" case where IsError is part of the response. This is part of the MCP Spec.

Motivation

Traces like this not marked as errors.

Closes https://datadoghq.atlassian.net/browse/MLOB-4640

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running ./scripts/lint.sh locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@github-actions github-actions bot added the apm:ecosystem contrib/* related feature requests or bugs label Nov 20, 2025
Copy link
Contributor Author

jboolean commented Nov 20, 2025

@pr-commenter
Copy link

pr-commenter bot commented Nov 20, 2025

Benchmarks

Benchmark execution time: 2025-11-20 21:36:35

Comparing candidate commit 50ff2b2 in PR branch jb/contrib-mcp-go-tool-is-error with baseline commit a01f947 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 3 metrics, 0 unstable metrics.

@jboolean jboolean marked this pull request as ready for review November 20, 2025 16:53
@jboolean jboolean requested review from a team as code owners November 20, 2025 16:53
@datadog-official
Copy link
Contributor

datadog-official bot commented Nov 20, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 50ff2b2 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@jboolean jboolean requested a review from hannahkm November 20, 2025 18:29
@jboolean jboolean force-pushed the jb/contrib-mcp-go-tool-is-error branch from 071b62d to 55d4452 Compare November 20, 2025 19:42
@jboolean jboolean force-pushed the jb/simplified-way-to-add-tracing branch from ae93ce3 to 1c7172d Compare November 20, 2025 19:42
Base automatically changed from jb/simplified-way-to-add-tracing to main November 20, 2025 20:20
@jboolean jboolean force-pushed the jb/contrib-mcp-go-tool-is-error branch from 55d4452 to 50ff2b2 Compare November 20, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apm:ecosystem contrib/* related feature requests or bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants