Module helpers

Module helpers 

Source
Expand description

Contains helper functions to simplify common tasks when building an MCP agent.

Functionsยง

create_content_response
Creates a simple text-based response.
create_error_response
Creates a response indicating an application-level error.
create_function_response
Creates a response containing the result of a single function call.
create_streaming_content_chunk
Creates a streaming chunk containing a piece of text content.
create_streaming_error_chunk
Creates a streaming chunk indicating an application-level error.
create_streaming_tool_result_chunk
Creates a streaming chunk containing the result of a single function call.
create_tool_result
Creates a ToolResult from a tool call ID and a serializable payload.
parse_function_args
Parses the JSON arguments from a ToolCall into a specific type.