Every call you'll ever make to an LLM API is a Python list full of dicts. That's it. Learn those two structures plus a for loop and you know the shape of agentic code before writing a line of it.
1) A list is an ordered box you access by position. A numbered coat rack: ["a", "b", "c"], and my_list[0] grabs the first coat. The order isn't decoration, it's the meaning: a conversation is a sequence.
2) A dict is a labeled box you access by name. A filing cabinet with labeled folders: {"role": "user", "content": "hi"}, and my_dict["role"] pulls out "user". Since Python 3.7, insertion order is an official part of the language spec: a cabinet that also remembers the order you filed things.
3) A loop does one action for every item in the box, in order. An agent loop is literally that: send the list, read what came back, append it, send again.
Every major chat API takes a flavor of this, and MCP servers speak JSON-RPC 2.0, so their tool definitions arrive as dicts too.
Where beginners crash: content isn't always a string. In Claude's Messages API it can be a plain string OR a list of content blocks, each its own dict with a "type" (text, image, tool_use, tool_result, thinking). A real agent is dicts nested in lists nested in dicts. Assume msg["content"] is text and your code breaks the moment a tool call shows up. Read block["type"] first.
Ordering is enforced, not stylistic: a tool result goes back as a user message, its tool_result blocks must come FIRST in that content list, and it must immediately follow the assistant turn that asked for the tool. Text ahead of them returns a 400.