helpers
Class info¶
🛈 DocStrings¶
Helper functions for MCP server client operations.
This module contains stateless utility functions that support MCP tool conversion and content handling for PydanticAI integration.
extract_text_content
¶
extract_text_content(mcp_content: list[ContentBlock]) -> str
Extract text content from MCP content blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp_content
|
list[ContentBlock]
|
List of MCP content blocks |
required |
Returns:
| Type | Description |
|---|---|
str
|
First available text content or fallback string |
Source code in src/llmling_agent/mcp_server/helpers.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |
mcp_tool_to_fn_schema
¶
mcp_tool_to_fn_schema(tool: Tool) -> dict[str, Any]
Convert MCP tool to OpenAI function schema format.
Source code in src/llmling_agent/mcp_server/helpers.py
21 22 23 24 25 26 27 | |