Skip to content

[Automated] Draft docs (kagent): adk/mcp: defer tool discovery until invocation - #732

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
pr-tracker-draft-kagent-3560
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
pr-tracker-draft-kagent-3560

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

The target's own content scan fails where the base build passed (docs-theme-extras markdown-leaks / built-html-integrity):

  • markdown-leaks.spec.ts > markdown-leaks: rendered HTML scan > no leaked markdown across built HTML pages

kagent-dev/kagent#3560 — adk/mcp: defer tool discovery until invocation

Docs versions: main

No code-path rule covers 3 touched file(s). The planner could route these only by identifier search, so the candidate pages may miss what they changed, including in the other mode:

  • go/adk/examples/oneshot/main.go
  • go/adk/pkg/agent/agent.go
  • go/adk/pkg/agent/mcp_apps.go

What changes for users: Agents on the kagent harness no longer wait for MCP tool discovery during startup, readiness, or Session resume. If one MCP server's catalog fails during an A2A execution, that server's tools are omitted for the execution, other MCP servers can still supply tools, and the next execution retries the omitted server.

What the docs now say: The About tools page now explains runtime MCP discovery, filtered cached catalogs, retry scope, and the separation from controller-side discovery. The caller token passthrough section now says a request with no bearer token omits the server's tools for that execution.

How kagent-3560 was drafted

Plan, and what changed it

  • Planned: Add the lazy MCP discovery behavior to the page that owns MCP tool bindings.
  • Learned: skills-and-mcp/about-tools.md already owns MCP binding behavior and carried a stale token-passthrough failure sentence; the target page and the code diff showed the correction.
  • Did: Updated skills-and-mcp/about-tools.md with a runtime discovery subsection and corrected the token-passthrough sentence.

Why a documentation change is necessary

The release note says MCP discovery no longer delays startup or resume and caches filtered tools safely. the code diff shows that the kagent runtime now discovers MCP tools during invocation preparation, filters the catalog before the model sees it, omits a failed toolset for the current A2A execution, and retries on a later execution. The About tools page documents MCP bindings and previously said a missing caller token made the MCP request fail, so readers would expect a different runtime behavior than the one in the diff.

How to verify this change

  1. In a kagent code checkout that includes this PR, run the MCP discovery unit tests, such as go test ./go/adk/pkg/mcp -run 'TestCreateToolsetsDoesNotContactSlowServers|TestFailedClassificationIsOmittedUntilNextRun|TestSDKCachePreservesFilteredToolsAndAppMetadata'.
  2. Run the A2A MCP discovery tests, such as go test ./go/adk/pkg/a2a -run TestKAgentExecutorScopesMCPDiscoveryFailures and go test ./go/adk/pkg/a2a/server -run TestReadinessDoesNotWaitForMCPDiscovery.
  3. On a kagent test cluster, create an AgentTemplate with one healthy RemoteMCPServer and one server whose tools/list fails, then invoke the Agent twice. The first execution should expose only the healthy server's tools, and a later execution should retry the previously omitted server.

Proposed release note

No proposed-release-note.md written because markers.notes_placeable is false. Text for reviewer use: MCP discovery no longer delays startup or resume and caches filtered tools safely.

Files in this pull request

  • docs-site/content/kagent/main/skills-and-mcp/about-tools.md
How the pages were chosen (triage report)

Feature clusters

Kept apart on purpose. Merging wrongly produces a guide that documents two things and explains neither, so these are reported for a person to merge rather than grouped automatically:

Draft a documentation change

kagent-dev/kagent#3560 — adk/mcp: defer tool discovery until invocation

  • Product: kagent (upstream) → kagent-dev/website
  • Docs version: main
  • Release note: MCP discovery no longer delays startup or resume and caches filtered tools safely.
  • Not tested: no cluster was available, so every command in this diff is unrun
  • No rule covers 3 touched file(s). The candidate pages below come from the files that DID match a rule, so they may scope this narrower than the change is. Read these before deciding the change is only about the pages listed:
    • go/adk/examples/oneshot/main.go
    • go/adk/pkg/agent/agent.go
    • go/adk/pkg/agent/mcp_apps.go

Draft branch: pr-tracker-draft-kagent-3560


Important

The test suite has not run on this pull request. It was opened by github-actions[bot], and GitHub does not start workflows for pull requests opened with the repository's own token. This repository's checks are held as action_required until somebody presses Approve and run on the Checks tab. Checks that come from GitHub Apps rather than Actions, such as DCO, run on their own.

Please approve the checks before reviewing the content: an absence of failures here means the tests have not run, not that they passed.

…invocation

Signed-off-by: GitHub Action <action@github.com>
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.

1 participant