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 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
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
extract_tool_call_args
¶
Extract tool call arguments from message history.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
messages
|
list[ModelMessage]
|
List of messages to search through |
required |
tool_call_id
|
str
|
ID of the tool call to find |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dictionary of tool call arguments |
Source code in src/llmling_agent/mcp_server/helpers.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
mcp_tool_to_fn_schema
¶
Convert MCP tool to OpenAI function schema format.
Source code in src/llmling_agent/mcp_server/helpers.py
24 25 26 27 28 29 30 | |