PromptisePromptise
Docs
GitHub
Promptise - AI Framework LogoPromptise

The foundation layer for agentic intelligence. Build, secure and operate autonomous AI systems with Promptise Foundry.

pip install promptise

[01] Foundry

  • MCPcast
  • The Promptise Agent
  • Reasoning Engine
  • MCP
  • Agent Runtime
  • Prompt Engineering
  • Execution Engine
  • Agent Identity

[02] Resources

  • Documentation
  • GitHub
  • Guides
  • Learning Paths
  • Questions

[03] Company

  • About
  • Terms of Service
  • Privacy Policy
  • Cookie Policy
  • Subprocessors

© 2026 Promptise by Manser Ventures. All rights reserved.

Open source · Python

← Learning paths> Agentic Engineering with Promptise Foundry
Lesson 08 / 71
11%

Claude AI Agent with MCP: Use Anthropic Models in Promptise

Build a Claude AI agent with MCP tools: set the Anthropic key and model id, use effort instead of temperature, add prompt caching, and fix common errors.

Beginner11 minModel Context Protocol (MCP)
All 71 lessons↓
  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓What Is an Agent Harness? Parts and How to Build One
  4. ✓System Prompt Best Practices for AI Agents in Python
  5. ✓Best LLM for AI Agents: Test and Switch Models in Python
  6. ✓AI Agent YAML: Define and Run an Agent From a Config File
  7. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  8. 08Claude AI Agent with MCP: Use Anthropic Models in Promptise
  9. 09Gemini AI Agent with MCP: Use Google Models in Promptise
  10. 10Azure OpenAI Agent with MCP: Use Deployments in Promptise
  11. 11OpenRouter AI Agent with MCP: Many Models in Promptise
  12. 12Ollama AI Agent with MCP: Run Local Models in Promptise
  13. 13LLM Semantic Cache and Model Fallback in Python
  14. 14What Is MCP (Model Context Protocol)? A Developer's Guide
  15. 15What Is Tool Calling? LLM Function Calling Explained
  16. 16MCP Tools vs Resources vs Prompts (With Python Examples)
  17. 17How to Connect MCP Servers to Your AI Agent in Python
  18. 18Build a Production MCP Server in Python (Step by Step)
  19. 19MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  20. 20FastAPI MCP Server: Turn Your FastAPI App into MCP Tools
  21. 21OpenAPI to MCP: Turn Any REST API into an MCP Server
  22. 22MCP Authentication in Python: API Keys, JWT and OAuth
  23. 23Build an Authenticated MCP Server for Your AI Agent (Python)
  24. 24MCP Security Best Practices: A Checklist for MCP Servers
  25. 25Testing MCP Servers in Python: pytest Without a Live Server
  26. 26Too Many MCP Tools? LLM Tool Selection, Measured
  27. 27MCP Server Caching, Timeouts and Circuit Breakers in Python
  28. 28MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  29. 29AI Agent Audit Logging: Tamper-Evident Logs in Python
  30. 30AI Agent Human in the Loop: Approve Tool Calls in Python
  31. 31AI Agent Prompt Injection: How to Defend Against It
  32. 32Build a Multi-Agent System in Python (and When Not To)
  33. 33Context Engineering for AI Agents: Context Window Management
  34. 34How to Deploy an AI Agent with Docker (2026 Guide)
  35. 35LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  36. 36MCP Long-Running Tasks: Background Jobs in Python
  37. 37MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  38. 38Python AI Agent Frameworks Compared: Which to Choose (2026)
  39. 39Self-Improving AI Agent: Learn From Tool Failures in Python
  40. 40AI Agent Identity: Authenticate Agents to MCP Servers
  41. 41Code-Action Agents in Python: One Program vs 37 Tool Calls
  42. 42Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  43. 43What Is Agentic RAG? How It Differs from Classic RAG
  44. 44AI Agent Memory in Python: Short-Term and Long-Term
  45. 45Agentic RAG in Python: Give Your AI Agent a Search Tool
  46. 46AI Agent Reasoning Patterns in Python: 9 Patterns Tested
  47. 47Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  48. 48Self-Modifying AI Agent in Python: Open Mode & Limits
  49. 49CrewAI Alternatives: 7 Options and How to Migrate (2026)
  50. 50Migrate from AutoGen: Agent Framework, Promptise and More
  51. 51What Is an LLM Guardrail? Types, Examples and Limits
  52. 52AI Agent Guardrails in Python: Block Injection, Redact PII
  53. 53AI Agent Code Execution Sandbox: Run LLM Code Safely
  54. 54AI Agent Production Checklist: What to Check Before Launch
  55. 55Approval Fatigue: Auto-Approve Safe AI Agent Actions
  56. 56What Is Human in the Loop AI? Approvals for AI Agents
  57. 57AI Agent Notifications: Webhook and Slack Alerts in Python
  58. 58AI Agent Observability: Trace Tool Calls, Tokens and Cost
  59. 59AI Agent Stuck in a Loop? How to Detect and Stop It
  60. 60How to Run, Debug and Deploy an AI Agent in Python
  61. 61AI Agent Cost Tracking: Tokens and Cost per Run and User
  62. 62How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  63. 63AI Agent Cost Control: Budgets That Stop Runaway Spend
  64. 64How to Test LLM Prompts and AI Agents in Python
  65. 65AI Agent Evals in CI: Run Them on Every Pull Request
  66. 66Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  67. 67Event-Driven AI Agents: Webhook, Cron and File Triggers
  68. 68Durable AI Agents: Crash Recovery and Safe Resume
  69. 69Deploy AI Agents in Production: Long-Running Python Agents
  70. 70What Is an AI Agent Framework? When You Need One
  71. 71LangGraph Alternatives: 7 Options and How to Migrate (2026)

Lessons in this path

  1. ✓What Is an AI Agent? Definition, How It Works, Examples
  2. ✓How to Build an AI Agent in Python (2026 Guide)
  3. ✓What Is an Agent Harness? Parts and How to Build One
  4. ✓System Prompt Best Practices for AI Agents in Python
  5. ✓Best LLM for AI Agents: Test and Switch Models in Python
  6. ✓AI Agent YAML: Define and Run an Agent From a Config File
  7. ✓Streaming LLM Responses with FastAPI: Tokens and Tool Calls
  8. 08Claude AI Agent with MCP: Use Anthropic Models in Promptise
  9. 09Gemini AI Agent with MCP: Use Google Models in Promptise
  10. 10Azure OpenAI Agent with MCP: Use Deployments in Promptise
  11. 11OpenRouter AI Agent with MCP: Many Models in Promptise
  12. 12Ollama AI Agent with MCP: Run Local Models in Promptise
  13. 13LLM Semantic Cache and Model Fallback in Python
  14. 14What Is MCP (Model Context Protocol)? A Developer's Guide
  15. 15What Is Tool Calling? LLM Function Calling Explained
  16. 16MCP Tools vs Resources vs Prompts (With Python Examples)
  17. 17How to Connect MCP Servers to Your AI Agent in Python
  18. 18Build a Production MCP Server in Python (Step by Step)
  19. 19MCP Transports: stdio vs Streamable HTTP vs SSE (Python)
  20. 20FastAPI MCP Server: Turn Your FastAPI App into MCP Tools
  21. 21OpenAPI to MCP: Turn Any REST API into an MCP Server
  22. 22MCP Authentication in Python: API Keys, JWT and OAuth
  23. 23Build an Authenticated MCP Server for Your AI Agent (Python)
  24. 24MCP Security Best Practices: A Checklist for MCP Servers
  25. 25Testing MCP Servers in Python: pytest Without a Live Server
  26. 26Too Many MCP Tools? LLM Tool Selection, Measured
  27. 27MCP Server Caching, Timeouts and Circuit Breakers in Python
  28. 28MCP vs CLI for AI Agents: Tokens, Security, When to Use Each
  29. 29AI Agent Audit Logging: Tamper-Evident Logs in Python
  30. 30AI Agent Human in the Loop: Approve Tool Calls in Python
  31. 31AI Agent Prompt Injection: How to Defend Against It
  32. 32Build a Multi-Agent System in Python (and When Not To)
  33. 33Context Engineering for AI Agents: Context Window Management
  34. 34How to Deploy an AI Agent with Docker (2026 Guide)
  35. 35LLM Tool Rate Limiting: Per-Client Limits for MCP Servers
  36. 36MCP Long-Running Tasks: Background Jobs in Python
  37. 37MCP Server Monitoring: Prometheus, OpenTelemetry and Logs
  38. 38Python AI Agent Frameworks Compared: Which to Choose (2026)
  39. 39Self-Improving AI Agent: Learn From Tool Failures in Python
  40. 40AI Agent Identity: Authenticate Agents to MCP Servers
  41. 41Code-Action Agents in Python: One Program vs 37 Tool Calls
  42. 42Multi-Tenant AI Agents: Keep Each Customer's Data Apart
  43. 43What Is Agentic RAG? How It Differs from Classic RAG
  44. 44AI Agent Memory in Python: Short-Term and Long-Term
  45. 45Agentic RAG in Python: Give Your AI Agent a Search Tool
  46. 46AI Agent Reasoning Patterns in Python: 9 Patterns Tested
  47. 47Plan-and-Execute Agents in Python: Beyond the ReAct Loop
  48. 48Self-Modifying AI Agent in Python: Open Mode & Limits
  49. 49CrewAI Alternatives: 7 Options and How to Migrate (2026)
  50. 50Migrate from AutoGen: Agent Framework, Promptise and More
  51. 51What Is an LLM Guardrail? Types, Examples and Limits
  52. 52AI Agent Guardrails in Python: Block Injection, Redact PII
  53. 53AI Agent Code Execution Sandbox: Run LLM Code Safely
  54. 54AI Agent Production Checklist: What to Check Before Launch
  55. 55Approval Fatigue: Auto-Approve Safe AI Agent Actions
  56. 56What Is Human in the Loop AI? Approvals for AI Agents
  57. 57AI Agent Notifications: Webhook and Slack Alerts in Python
  58. 58AI Agent Observability: Trace Tool Calls, Tokens and Cost
  59. 59AI Agent Stuck in a Loop? How to Detect and Stop It
  60. 60How to Run, Debug and Deploy an AI Agent in Python
  61. 61AI Agent Cost Tracking: Tokens and Cost per Run and User
  62. 62How to Evaluate AI Agents: Evals, LLM Judges and pass^k
  63. 63AI Agent Cost Control: Budgets That Stop Runaway Spend
  64. 64How to Test LLM Prompts and AI Agents in Python
  65. 65AI Agent Evals in CI: Run Them on Every Pull Request
  66. 66Autonomous AI Agent Runtime: Budgets, Crash Recovery, API
  67. 67Event-Driven AI Agents: Webhook, Cron and File Triggers
  68. 68Durable AI Agents: Crash Recovery and Safe Resume
  69. 69Deploy AI Agents in Production: Long-Running Python Agents
  70. 70What Is an AI Agent Framework? When You Need One
  71. 71LangGraph Alternatives: 7 Options and How to Migrate (2026)
← Path overview

This guide shows how to build a Claude AI agent with MCP tools: an agent that runs on Anthropic's Claude models and calls tools from a Model Context Protocol server. It is for developers who already know what they want the agent to do and need the Anthropic setup to be right: the key, the model id, the settings that current Claude models accept, and the errors you will see when something is off. You will end with one small file you can point at any MCP server.

[01]

How do you use Claude with Promptise?

Install promptise, put your Anthropic key in ANTHROPIC_API_KEY, and pass a Claude model to build_agent(), either as the string "anthropic:claude-opus-5-5" or as Model("claude-opus-5-5", provider="anthropic"). Promptise reaches Claude through LangChain's native ChatAnthropic integration, which is part of the core install. Add your MCP servers in servers=. The agent discovers their tools, sends them to Claude as tool definitions, runs the calls Claude asks for, and loops until Claude gives a final answer.

  • Nothing extra to install. langchain-anthropic is a core dependency of Promptise, so pip install promptise is the whole setup.

  • One prefix, two spellings. anthropic: and claude: select the same provider.

  • Don't set `temperature` on current Claude models. Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models reject sampling parameters at non-default values. Use effort instead.

  • Check before you spend. promptise models check claude:<model> tells you what is missing without calling the model. --ping makes one real call.

  • Claude never talks to your MCP server directly. Promptise is the MCP client. Claude only sees tool definitions and tool results.


[02]

Set up Anthropic

You need Python 3.10 or later, an Anthropic API key from the Claude Console, and Promptise Foundry 1.4.2 or later:

>_Terminal
pip install "promptise>=1.4.2"

Put the key in a .env file next to your script. Promptise loads the nearest .env file automatically (from the working directory up to the project root), and a variable already exported in your shell wins over the file. promptise models env anthropic prints the line to fill in:

Output
# Anthropic Claude — model string example: anthropic:claude-sonnet-4-5
export ANTHROPIC_API_KEY=sk-ant-...
#   ↳ console.anthropic.com → API keys

Then check the configuration. Nothing set yet:

Output
$ promptise models check claude:claude-opus-5-5
claude:claude-opus-5-5 → anthropic:claude-opus-5-5  (Anthropic Claude)
  model part: claude-opus-5-5 — the model name
  route: native integration (core)
  ANTHROPIC_API_KEY: MISSING — console.anthropic.com → API keys
Not usable yet.
  - ANTHROPIC_API_KEY is not set — console.anthropic.com → API keys (e.g. sk-ant-...)
  - put ANTHROPIC_API_KEY in a .env file next to your script (loaded automatically; a variable already exported with a non-empty value wins, an empty one is filled from the file), export it, or pass it in code: Model(..., api_key=) — see promptise 
models env anthropic

With the key in place, the same command reports the route and stops before calling anything:

Output
$ promptise models check claude:claude-opus-5-5
claude:claude-opus-5-5 → anthropic:claude-opus-5-5  (Anthropic Claude)
  model part: claude-opus-5-5 — the model name
  route: native integration (core)
  ANTHROPIC_API_KEY: set — console.anthropic.com → API keys
Configuration OK — every required setting is in place; nothing was called. Add --ping to make a real one-token call to the model.

"Configuration OK" means the variable is set, not that the key works. Add --ping for a one-token call that proves the key and the model id are accepted.

Which model id to use

Use the exact ids from Anthropic's models overview. At the time of writing, the current models include:

Model

Model id

Good for

---|---|---

Claude Opus 5.5

claude-opus-5-5

The default for agents that plan and use many tools

Claude Sonnet 5.5

claude-sonnet-5-5

Everyday agent work where speed matters more

Claude Haiku 5.5

claude-haiku-5-5

Routing, classification and high-volume simple steps

Use the ids as written, without date suffixes. Model lists change, so check the overview page before you pin one in production. For choosing between providers, see the best LLM for AI agents.


[03]

Build a minimal Claude AI agent

The agent below answers questions about a shop's products. The model is configured once, at the top of the file, so the rest of the code doesn't depend on the provider:

Pythonclaude_agent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import asyncio
import sys

from promptise import Model, build_agent
from promptise.config import StdioServerSpec

# The key comes from ANTHROPIC_API_KEY (environment or .env).
CLAUDE = Model("claude-opus-5-5", provider="anthropic", max_tokens=16000, extra={"effort": "medium"})


async def make_agent(model=CLAUDE):
    return await build_agent(
        model=model,
        servers={"shop": StdioServerSpec(command=sys.executable, args=["shop_server.py"])},
        instructions="You answer questions about the shop's products. "
                     "Use the tools for stock and prices. Never guess them.",
        max_agent_iterations=10,
    )


async def main():
    agent = await make_agent()
    try:
        result = await agent.ainvoke(
            {"messages": [{"role": "user", "content": "Is KB-101 in stock, and what does it cost?"}]}
        )
        calls = [c["name"] for m in result["messages"] for c in getattr(m, "tool_calls", None) or []]
        print("tool calls:", ", ".join(calls) or "none")
        print(result["messages"][-1].text)
    finally:
        await agent.shutdown()


if __name__ == "__main__":
    asyncio.run(main())

What each part does:

  • `Model("claude-opus-5-5", provider="anthropic", ...)` names the model and the provider. The key isn't in the code: it comes from ANTHROPIC_API_KEY. You can pass api_key= instead when the key comes from a secret store.

  • `max_tokens=16000` caps each response. Without it, LangChain uses the model's maximum output length, which is far more than an agent turn needs.

  • `extra={"effort": "medium"}` is passed straight through to ChatAnthropic, which sends it as output_config.effort. Effort is how you trade thoroughness against tokens on current Claude models. low suits simple lookups, and high suits multi-step planning.

  • `max_agent_iterations=10` stops a run that keeps calling tools without converging.

  • `result["messages"][-1].text` reads the answer. Claude's replies can contain several content blocks (thinking and text), so .text is safer than .content, which may be a list.

Run it with python claude_agent.py. With a valid key, the script prints the names of the tools Claude called and then its answer.


[04]

Use MCP tools with Claude

The tools come from a small MCP server that the agent starts as a subprocess over stdio:

Pythonshop_server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""A small MCP tool server: product stock and prices for a shop."""
from promptise.mcp.server import MCPServer

server = MCPServer("shop")

STOCK = {"KB-101": 14, "MS-220": 0, "HD-350": 3}
PRICES = {"KB-101": 89.00, "MS-220": 39.50, "HD-350": 129.00}


@server.tool()
async def check_stock(sku: str) -> dict:
    """How many units of a product (by SKU) are in stock."""
    if sku not in STOCK:
        return {"sku": sku, "error": "unknown SKU"}
    return {"sku": sku, "in_stock": STOCK[sku]}


@server.tool()
async def get_price(sku: str) -> dict:
    """The current price of a product (by SKU), in USD."""
    if sku not in PRICES:
        return {"sku": sku, "error": "unknown SKU"}
    return {"sku": sku, "price_usd": PRICES[sku]}


if __name__ == "__main__":
    server.run()  # stdio by default

Here is what happens on each run:

Text
1
2
3
4
5
6
7
your code ──ainvoke──▶ Promptise agent ──tool definitions + messages──▶ Claude (Anthropic API)
                          │      ▲                                        │
                          │      └──────── tool_use: check_stock(KB-101) ◀┘
                          ▼
                  MCP client ──stdio──▶ shop_server.py
                          │
                          └── tool result ──▶ next Claude call ──▶ final answer

When the agent is built, Promptise connects to every server in servers=, lists its tools and turns each one into a LangChain tool with the MCP input schema. On every model call, those tools go to Claude as tool definitions. When Claude replies with a tool_use block, Promptise calls the MCP tool, adds the result to the conversation and calls Claude again. Promptise keeps Claude's reply message as returned, thinking blocks included, in the conversation between tool calls, which current Claude models expect.

To use a remote MCP server instead of a local script, replace the stdio spec with HTTPServerSpec(url="https://tools.example.com/mcp", bearer_token="...") from promptise.config. Nothing about the Claude side changes. The MCP connection guide covers transports, authentication and many servers at once.

Anthropic also offers a server-side MCP connector, where the Claude API itself connects to a remote MCP server. It is a different design: the API, not your process, holds the connection, so it only reaches servers that are publicly reachable. With Promptise, tool calls run in your process, so private servers, approval gates and guardrails all work.


[05]

Claude-specific notes

Settings current models accept

Claude Opus 5.5, Sonnet 5.5, Haiku 5.5 and the Fable models reject temperature, top_p and top_k at non-default values. Leave temperature out of Model(...) for these models. Thinking is adaptive and on by default, so you don't need a thinking setting. Control depth and cost with effort (low, medium, high, xhigh, max). On Opus 5.5 the default effort is medium, so set it explicitly if you want something else. Anthropic's models overview lists which settings each model supports.

Tool choice

Promptise binds tools with automatic tool choice: Claude decides whether to call a tool. This matters because the newest Claude models return an error for forced tool choice. Put "use the tools for stock and prices" in the instructions, as the example does, rather than forcing a call.

Prompt caching

An agent resends its system prompt and tool definitions on every turn. Anthropic's prompt caching makes repeated prefixes cheaper. You can turn on automatic caching through the same pass-through:

Python
1
2
3
4
5
6
CLAUDE = Model(
    "claude-opus-5-5",
    provider="anthropic",
    max_tokens=16000,
    extra={"effort": "medium", "cache_control": {"type": "ephemeral"}},
)

ChatAnthropic sends cache_control as a top-level request field, which tells the API to cache up to the last cacheable block. Caching only applies above a minimum prefix length, so a tiny agent like the example may see no cache reads. Check usage_metadata on the reply, or turn on agent observability, to confirm hits.

Limits and pricing

Rate limits depend on your organization's usage tier and are listed on Anthropic's rate limits page. Prices per million input and output tokens are on the pricing page. Prices differ a lot between Opus, Sonnet and Haiku, so put a budget on the agent before you run it on real traffic. The cost control guide shows how.

Claude through a gateway or a cloud provider

The endpoint= word overrides the base URL, for example for a corporate gateway that speaks the Anthropic API. For Claude on Amazon Bedrock, use the bedrock provider with a Bedrock model id instead. Bedrock's prices and limits are set by AWS.

Falling back to another provider

A FallbackChain tries models in order, so an Anthropic outage doesn't take the agent down:

Python
1
2
3
4
5
6
7
from promptise import FallbackChain

model = FallbackChain(
    [CLAUDE, "openai:gpt-5-mini"],
    timeout_per_model=60,
)
agent = await make_agent(model=model)

Keep the instructions provider-neutral if you do this, and test the agent with both models. More patterns are in the semantic cache and fallback guide.


[06]

Common problems and fixes

Symptom

Cause

Fix

---|---|---

ANTHROPIC_API_KEY is not set from promptise models check or build_agent

The key isn't in the environment or in a .env file Promptise can find

Add it to .env next to the script, export it, or pass api_key=

AnthropicAuthenticationError: Error code: 401 ... 'invalid x-api-key'

The key is wrong, revoked or from another organization

Create a new key in the Claude Console and replace it

A ValueError from LangChain saying temperature is not supported at non-default values, or a 400 about sampling parameters from the API

temperature, top_p or top_k set for a model that doesn't accept them

Remove them and use effort

A 400 about tool_choice

A forced tool choice (any or a named tool), for example on a chat model you built yourself and passed in

Use automatic tool choice and steer the model with instructions

A 404 not_found_error for the model

A typo in the id, or an id with a date suffix

Copy the id from the models overview page

429 rate_limit_error

Your usage tier's request or token limit

Back off and retry, lower concurrency, or add a FallbackChain

The agent answers without calling a tool

The instructions don't tell Claude when to use the tools

Say which questions need which tools, and check the tool descriptions on the server

This is the real output of the ping with a key that isn't valid:

Output
$ promptise models check claude:claude-opus-5-5 --ping
Pinging… failed
AnthropicAuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011Cg9mdnJ3S2ztDcLzirkwK'}
  → the provider rejected the credential — check ANTHROPIC_API_KEY (console.anthropic.com → API keys)

[07]

Frequently asked questions

Do I need the Anthropic Python SDK to build a Claude agent with Promptise?

No separate install is needed. Promptise depends on langchain-anthropic, which depends on the official anthropic SDK, so both are installed with pip install promptise. You don't call the SDK directly: build_agent() builds the ChatAnthropic client from your Model settings and runs the tool loop for you.

Can a Claude agent use MCP servers that run on my own network?

Yes. Promptise is the MCP client, and it runs in your process, so it can reach a stdio server on the same machine or an HTTP server on a private network. Claude receives only the tool definitions and the tool results. This differs from a server-side MCP connector, which needs a server the Claude API can reach over the internet.

Which Claude model should I use for an AI agent?

Start with Claude Opus 5.5 for agents that plan across several tools, and move steps to Sonnet 5.5 or Haiku 5.5 when you can show they hold up on your own tasks. The way to decide is an evaluation on your real tool calls, which the best LLM for AI agents guide walks through.

How do I control how much Claude thinks?

Use effort. Pass it through Model(..., extra={"effort": "low"}), and Promptise forwards it to the Anthropic API as output_config.effort. Lower effort uses fewer tokens and fewer, more consolidated tool calls. Higher effort helps on hard multi-step tasks. Current models choose how much to think on their own within that setting.

Can I switch an existing agent from OpenAI to Claude?

Yes. Change the model string or Model(...) and keep the rest. Remove temperature if you set it, because current Claude models reject it. Then rerun your tests, because two models given the same tools and instructions won't make the same choices.


[08]

Next steps

  • Build the full agent step by step: how to build an AI agent.

  • Write the tool side properly: build a production MCP server.

  • Compare models on your own tasks: best LLM for AI agents.

  • Learn what MCP is and isn't: what is the Model Context Protocol.

  • Every provider setting in one place: Models and providers reference.

← PreviousStreaming LLM Responses with FastAPI: Tokens and Tool CallsNext lesson →Gemini AI Agent with MCP: Use Google Models in Promptise