anthropics / anthropics/claude-agent-sdk-python

Allow SDK MCP Servers to return structured data

Open
#695 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
8.1k
Forks
1.3k
Avg merge
2d 31m
Merged PRs (30d)
1

Description

Currently it only allows either a text or image response due to how it collects the results from the tool:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L322

When I want to return JSON now, I have to JSON marshal it, and then return that, causing a lot of extra tokens and also makes it harder to read for the Agent when it goes over the amount of tokens and has to write away the tool results to a file, because everything is written away to a single line in this format.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.