# 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/9f232caa7a8fe1ca042a401942d5d90d54ceb1a6/libs/langchain/langchain_classic/agents/output_parsers/tools.py#L24)