# parse_ai_message_to_tool_action

> **Function** in `langchain_classic`

📖 [View in docs](https://reference.langchain.com/python/langchain-classic/agents/output_parsers/tools/parse_ai_message_to_tool_action)

Parse an AI message potentially containing tool_calls.

## Signature

```python
parse_ai_message_to_tool_action(
    message: BaseMessage,
) -> list[AgentAction] | AgentFinish
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/185119f98e6286253a2326d7cf4f59592678023d/libs/langchain/langchain_classic/agents/output_parsers/tools.py#L24)