Skip to content

The tool result does not take into account the is_error flag. #564

@mlabeeb03

Description

@mlabeeb03

This comment says that we can indicate errors using and is_error flag:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L136

But the code does not take into account and only returns the text or image content:
https://github.com/anthropics/claude-agent-sdk-python/blob/main/src/claude_agent_sdk/__init__.py#L300-L309

I am using the result in the PostToolUse hook and I need the is_error flag to log failures of my tools in the DB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions