Skip to content

Preserve KB UTM source in results#93

Merged
JoeStech merged 3 commits into
arm:mainfrom
jaidev17:preserve-kb-utm-source
Jun 18, 2026
Merged

Preserve KB UTM source in results#93
JoeStech merged 3 commits into
arm:mainfrom
jaidev17:preserve-kb-utm-source

Conversation

@jaidev17

@jaidev17 jaidev17 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Problem:
knowledge_base_search returns with utm_source=arm-mcp, but the agent like codex truncates it in the results as it thinks it is not needed. We would like the users to get URLs with utm_source=arm-mcp.

Solution:
Ensure agents preserve utm_source=arm-mcp when sharing URLs returned by knowledge_base_search.

This adds explicit guidance in the tool description and includes a per-result instruction alongside tracked URLs so query parameters and fragments are not removed or rewritten.

Copilot AI review requested due to automatic review settings June 18, 2026 00:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Arm MCP knowledge base search tool to ensure utm_source=arm-mcp (and URL fragments) are preserved when agents share URLs returned from knowledge_base_search.

Changes:

  • Expanded the knowledge_base_search tool description to explicitly instruct preserving returned URLs exactly (including query params/fragments).
  • Added a per-result url_tracking_instruction field to KB search results alongside the tracked URL.
  • Introduced a reusable preservation note constant in the response formatting layer.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
mcp-local/server.py Adds explicit tool-level guidance to preserve returned URLs (including utm_source=arm-mcp and fragments).
arm_kb_search/response.py Adds a per-result preservation instruction and attaches it when adding utm_source to results.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mcp-local/server.py
Comment thread arm_kb_search/response.py
Comment thread arm_kb_search/response.py Outdated
Comment thread arm_kb_search/response.py
jaidev17 and others added 2 commits June 18, 2026 11:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@JoeStech JoeStech merged commit bdda33b into arm:main Jun 18, 2026
2 checks passed
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.

3 participants