> ## Documentation Index
> Fetch the complete documentation index at: https://docs.camel-ai.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Camel.parsers.mcp tool call parser

<a id="camel.parsers.mcp_tool_call_parser" />

Utility functions for parsing MCP tool calls from model output.

<a id="camel.parsers.mcp_tool_call_parser.extract_tool_calls_from_text" />

## extract\_tool\_calls\_from\_text

```python theme={"system"}
def extract_tool_calls_from_text(content: str):
```

Extract tool call dictionaries from raw text output.

<a id="camel.parsers.mcp_tool_call_parser._collect_tool_calls" />

## \_collect\_tool\_calls

```python theme={"system"}
def _collect_tool_calls(payload: Any, accumulator: List[Dict[str, Any]]):
```

Collect valid tool call dictionaries from parsed payloads.

<a id="camel.parsers.mcp_tool_call_parser._try_parse_json_like" />

## \_try\_parse\_json\_like

```python theme={"system"}
def _try_parse_json_like(snippet: str):
```

Parse a JSON or JSON-like snippet into Python data.

<a id="camel.parsers.mcp_tool_call_parser._find_json_candidate" />

## \_find\_json\_candidate

```python theme={"system"}
def _find_json_candidate(content: str, start_idx: int):
```

Locate a balanced JSON-like segment starting at `__INLINE_CODE_0__`.

<a id="camel.parsers.mcp_tool_call_parser._truncate_snippet" />

## \_truncate\_snippet

```python theme={"system"}
def _truncate_snippet(snippet: str, limit: int = 120):
```

Return a truncated representation suitable for logging.
