File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 704704 " reference/camel.loaders.unstructured_io"
705705 ]
706706 },
707+ {
708+ "group" : " Parsers" ,
709+ "pages" : [
710+ " reference/camel.parsers.mcp_tool_call_parser"
711+ ]
712+ },
707713 {
708714 "group" : " Runtimes" ,
709715 "pages" : [
Original file line number Diff line number Diff line change 1+ <a id = " camel.parsers.mcp_tool_call_parser" ></a >
2+
3+ Utility functions for parsing MCP tool calls from model output.
4+
5+ <a id = " camel.parsers.mcp_tool_call_parser.extract_tool_calls_from_text" ></a >
6+
7+ ## extract_tool_calls_from_text
8+
9+ ``` python
10+ def extract_tool_calls_from_text (content : str ):
11+ ```
12+
13+ Extract tool call dictionaries from raw text output.
14+
15+ <a id = " camel.parsers.mcp_tool_call_parser._collect_tool_calls" ></a >
16+
17+ ## _ collect_tool_calls
18+
19+ ``` python
20+ def _collect_tool_calls (payload : Any, accumulator : List[Dict[str , Any]]):
21+ ```
22+
23+ Collect valid tool call dictionaries from parsed payloads.
24+
25+ <a id = " camel.parsers.mcp_tool_call_parser._try_parse_json_like" ></a >
26+
27+ ## _ try_parse_json_like
28+
29+ ``` python
30+ def _try_parse_json_like (snippet : str ):
31+ ```
32+
33+ Parse a JSON or JSON-like snippet into Python data.
34+
35+ <a id = " camel.parsers.mcp_tool_call_parser._find_json_candidate" ></a >
36+
37+ ## _ find_json_candidate
38+
39+ ``` python
40+ def _find_json_candidate (content : str , start_idx : int ):
41+ ```
42+
43+ Locate a balanced JSON-like segment starting at ` __INLINE_CODE_0__ ` .
44+
45+ <a id = " camel.parsers.mcp_tool_call_parser._truncate_snippet" ></a >
46+
47+ ## _ truncate_snippet
48+
49+ ``` python
50+ def _truncate_snippet (snippet : str , limit : int = 120 ):
51+ ```
52+
53+ Return a truncated representation suitable for logging.
You can’t perform that action at this time.
0 commit comments