0Pricing
MCP Academy · Lesson

Discover Tools & Resources

List what a server offers programmatically.

Discover Tools & Resources is a free MCP Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MCP Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Ask Before You Act

A client should never assume what a server can do. Once connected, it discovers the available capabilities by asking the server to list them.

List the Tools

Call session.list_tools() and the server returns every tool it exposes, ready for your code to inspect.

result = await session.list_tools()

Read Each Tool

The result carries a tools list. Each entry has a name and a human-readable description so you know what it does.

for tool in result.tools:
    print(tool.name, tool.description)

Inspect the Input Shape

Every tool also exposes an inputSchema, a JSON Schema describing the arguments it accepts. This is how you learn what to send.

print(result.tools[0].inputSchema)

List the Resources

Servers can offer read-only data too. Call session.list_resources() to fetch the set of resources you may read.

res = await session.list_resources()

Resources Have URIs

Each resource is addressed by a uri, like a file path or a custom scheme. You use that uri later to fetch its contents.

for r in res.resources:
    print(r.uri, r.name)

List the Prompts

The third primitive is prompts. session.list_prompts() reveals reusable instruction templates the server publishes.

prompts = await session.list_prompts()

Discovery Is Capability-Gated

You only get what the server advertised at the handshake. If it declared no resources, listing them returns an empty set.

Build a Live Menu

Discovery means a client adapts at runtime. Plug in a new server and its tools simply appear, with no client code changes needed.

Feed It to a Model

Discovered tool names, descriptions, and schemas are exactly what a model needs to decide which tool fits a request later on.

Cache or Re-List

Tool lists can change, so a careful client may re-list after an update notification rather than trusting a stale snapshot.

Quick Check

Which session call returns the server tool list with their schemas?

Recap: Knowing the Menu

You learned to discover a server at runtime: list its tools, resources, and prompts, then read each name, description, and schema before acting.

Frequently asked questions

Is the “Discover Tools & Resources” lesson free?

Yes — the full text of “Discover Tools & Resources” is free to read here on the web, and the MCP Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MCP Academy course, upgrade to CoddyKit PRO.

What will I learn in “Discover Tools & Resources”?

List what a server offers programmatically. You practise MCP Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start MCP Academy?

No prior experience is required. MCP Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Discover Tools & Resources” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this MCP Academy lesson?

Yes. Every MCP Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Open a Client Session
  2. Discover Tools & Resources
  3. Invoke Tools from Code
  4. Route Tool Calls Through an LLM
← Back to MCP Academy