Skip to content

Built-in tools are native tools provided by LLM providers that can be used to enhance your agent's capabilities. They are executed directly by the model provider.

Overview

AgentPool supports the following PydanticAI built-in tools:

  • Web Search: Search the web using various providers
  • Code Execution: Execute code in a sandboxed environment
  • URL Context: Fetch and process content from URLs
  • Image Generation: Generate images using AI models
  • Memory: Persistent memory storage for agents
  • MCP Server: Connect to MCP server tools

These tools integrate seamlessly with the agent's capability system and can be configured with provider-specific options.

Configuration Reference

Web Search Tool

Configuration for PydanticAI web search builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: web_search
    search_context_size: high
    blocked_domains: ["spam.com"]

Web Search Tool (YAML)
- builtin_type: web_search
  search_context_size: medium  # The search context size parameter controls how much context is retrieved.
  user_location: null  # User location for localizing search results (city, country, region, timezone).
  blocked_domains: null  # Domains that will never appear in results.
  allowed_domains: null  # Only these domains will be included in results.
  max_uses: null  # Maximum number of times the tool can be used.
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.

Code Execution Tool

Configuration for PydanticAI code execution builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: code_execution

Code Execution Tool (YAML)
1
2
3
4
5
6
7
- builtin_type: code_execution
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.

Web Fetch Tool

Configuration for PydanticAI web fetch builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: web_fetch

Web Fetch Tool (YAML)
1
2
3
4
5
6
7
- builtin_type: web_fetch
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.

Image Generation Tool

Configuration for PydanticAI image generation builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: image_generation
    quality: high
    size: 1024x1024

Image Generation Tool (YAML)
- builtin_type: image_generation
  background: auto  # Background type for the generated image.
  input_fidelity: null  # Control how much effort the model will exert to match input image features.
  moderation: auto  # Moderation level for the generated image.
  output_compression: 100  # Compression level for the output image.
  output_format: null  # The output format of the generated image.
  partial_images: 0  # Number of partial images to generate in streaming mode.
  quality: auto  # The quality of the generated image.
  size: auto  # The size of the generated image.
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.

Memory Tool

Configuration for PydanticAI memory builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: memory

Memory Tool (YAML)
1
2
3
4
5
6
7
- builtin_type: memory
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.

MCP Server Tool

Configuration for PydanticAI MCP server builtin tool.

Example:

tools:
  - type: builtin
    builtin_type: mcp_server
    id: my_server
    url: https://api.example.com/mcp

MCP Server Tool (YAML)
- builtin_type: mcp_server
  server_id: my_mcp_server
  url: https://api.example.com/mcp  # The URL of the MCP server to use.
  authorization_token: null  # Authorization header to use when making requests to the MCP server.
  allowed_tools: null  # A list of tools that the MCP server can use.
  headers: null  # Optional HTTP headers to send to the MCP server.
  type: builtin  # Top-level discriminator - always 'builtin' for builtin tools.
  name: null  # Optional override for the tool name.
  description: null  # Optional override for the tool description.
  enabled: true  # Whether this tool is initially enabled.
  requires_confirmation: false  # Whether tool execution needs confirmation.
  metadata: {}  # Additional tool metadata.