Skip to content

feat(core): MCP Server - Capture prompt results from prompt function calls #17284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Aug 6, 2025

Conversation

betegon
Copy link
Member

@betegon betegon commented Aug 1, 2025

closes #17283

includes these attributes for mcp.server spans:

  • mcp.prompt.result.description
  • mcp.prompt.result.message_content
  • mcp.prompt.result.message_role
  • mcp.prompt.result.message_count

Example:
Screenshot 2025-08-01 at 12 40 46

Needed to make attributeExtraction.ts <300 lines of code (requirement) so it's now split between sessionExtraction.ts, sessionExtraction.ts and resultExtraction.ts.

So changes explained so it's easier to review:

  • The only function this PR adds is extractPromptResultAttributes inside resultExtraction.ts.
  • It adds the prompt results as PII in piiFiltering.ts. Just add them to the set.
  • adds a else if (method === 'prompts/get') to execute the extractPromptResultAttributes function.
  • adds a test that checks we're capturing the results and updates the PII test to check PII result attributes are being removed if sending PII is not enabled.

@betegon betegon self-assigned this Aug 1, 2025
@betegon
Copy link
Member Author

betegon commented Aug 1, 2025

@sentry review

@betegon betegon marked this pull request as ready for review August 5, 2025 18:31
@betegon betegon requested a review from AbhiPrasad August 5, 2025 18:31
Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

awesome

cursor[bot]

This comment was marked as outdated.

@AbhiPrasad
Copy link
Member

AbhiPrasad commented Aug 6, 2025

feel free to merge @betegon (make sure you squash and merge). Also if we need this backported to v9 you'll need to cherry-pick the commit and open it against the v9 branch.

@AbhiPrasad AbhiPrasad merged commit 0e05a40 into develop Aug 6, 2025
184 checks passed
@AbhiPrasad AbhiPrasad deleted the bete/mcp-server-prompt-results branch August 6, 2025 15:19
@AbhiPrasad
Copy link
Member

actually whatever I'll just do it 😄

@betegon
Copy link
Member Author

betegon commented Aug 6, 2025

thanks @AbhiPrasad . I'm on PTO this week so it's been a bit difficult to keep up 😆

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.

MCP Server - capture prompt results from prompt function calls
2 participants