Skip to content

Conversation

@thoorp
Copy link

@thoorp thoorp commented Dec 12, 2025

This PR adds support for the new agencyHint annotation to the Model Context Protocol Python SDK. The agencyHint boolean field in ToolAnnotations allows tools to signal that they encapsulate an internal “agent loop” (plan–act–observe cycles, tool chaining, or autonomous retries). This helps clients handle agent-like tools appropriately and differentiates them from simple single-step tools.

Motivation and Context

This change aligns the Python SDK with the latest MCP specification (SEP-1938) by adding the agencyHint flag. Tools that encapsulate agent loops may behave differently from simple tools, so exposing this hint allows orchestrators and clients to make better decisions about tool invocation.

How Has This Been Tested?

All existing tests have been run locally to ensure no regressions. The new field is optional and defaults to false, so it should not affect existing behavior. No additional tests were required because it is a schema-level change.

Breaking Changes

There are no breaking changes. The new field is optional and defaults to false.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling (not applicable – no new logic)
  • I have added or updated documentation as needed (docstring added for the new field)

Additional context

N/A

@maxisbey maxisbey marked this pull request as draft December 12, 2025 11:35
@maxisbey maxisbey added the pending SEP approval When a PR is attached as an implementation detail to a SEP, we mark it as such for triage. label Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending SEP approval When a PR is attached as an implementation detail to a SEP, we mark it as such for triage.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants