Skip to content

Conversation

@bokelley
Copy link
Contributor

@bokelley bokelley commented Dec 7, 2025

Summary

This PR adds human-readable message formatting for AdCP response types and confirms filter parameter support in the SDK.

Changes:

  • Implement __str__() methods on response types via registry pattern for MCP, A2A, and REST API messaging
  • Fix grammar and improve i18n readiness by using present participles instead of verb conjugation
  • Document filter parameter support (is_responsive, name_search) in ListCreativeFormatsRequest

All tests pass. Response messages use proper singular/plural forms with better multilingual support.

🤖 Generated with Claude Code

bokelley and others added 4 commits December 5, 2025 12:57
The Python SDK already supports is_responsive and name_search parameters
in ListCreativeFormatsRequest, as per the AdCP specification. These
tests document this support.

Note: The test agent server at test-agent.adcontextprotocol.org does not
yet expose these parameters in its MCP tool schema. This is a server-side
issue, not a client SDK issue. The SDK correctly passes these parameters
when supported by the server.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Implements issue #91: Response types now generate standardized,
human-readable messages when converted to strings. This enables
consistent messaging across MCP tool results, A2A task communications,
and REST API responses.

Implemented formatters for:
- GetProductsResponse
- ListCreativeFormatsResponse
- GetSignalsResponse
- ListAuthorizedPropertiesResponse
- ListCreativesResponse
- CreateMediaBuyResponse (success/error variants)
- UpdateMediaBuyResponse (success/error variants)
- SyncCreativesResponse (success/error variants)
- ActivateSignalResponse (success/error variants)
- PreviewCreativeResponse (single/batch variants)
- BuildCreativeResponse (success/error variants)
- GetMediaBuyDeliveryResponse
- ProvidePerformanceFeedbackResponse (success/error variants)

Messages use proper singular/plural forms and include relevant counts.
Non-response types fall back to Pydantic's default representation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changes message format from verb conjugation ("match/matches") to present
participle ("matching") for better multilingual support. Also explicitly
specifies irregular plural for "media buy" → "media buys". Removes unused
pytest import from test file.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Addresses ruff linter errors:
- Import Callable from collections.abc instead of typing (UP035)
- Create MessageFormatter type alias to shorten line length (E501)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley changed the title Add __str__ methods and filter params tests feat: add __str__ methods and filter params tests Dec 7, 2025
bokelley and others added 2 commits December 7, 2025 07:27
Changes "Found 0 products..." to "No products matched your requirements."
for a more natural user experience.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Switches from overriding __str__ to an explicit .summary() method:
- Avoids shadowing 'message' field in generated types (Error, etc.)
- Keeps str() for Pydantic's default repr (better for debugging)
- More explicit API: response.summary() vs str(response)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 6358542 into main Dec 7, 2025
7 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.

2 participants