In its reply the model writes which tool it wants to call and with which arguments. The agent's code runs the tool and adds the result to the conversation, and the model picks its next step by looking at that result.
In Claude Code, reading a file is the job of the Read tool and running a command is the job of Bash. Lines in the permission settings like Bash(git push *) start with a tool name too, and they say what happens when that call comes in.
Connect an MCP server and the agent's tool list gets longer, and the model calls the new tools the same way. In the free program you can follow in the terminal, line by line, which tool the agent calls at each step.