smithery.ai

pydantic-ai

Expert guidance on building agents and tools with Pydantic AI.

First seen Mar 31, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,296 B
  • docs SUMMARY.md 81 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Pydantic AI Expert Skill

This skill provides patterns for defining agents, dependencies, and tools using Pydantic AI.

🤖 Agent Definition

  • State Management: Use StateDeps[T] to pass dependencies (DB clients, settings) to agents.
  • System Prompts: Define complex prompts in src/prompts.py. Use @agent.instructions for dynamic context.
  • Model Choice: Use OpenAIModel as a base for OpenAI-compatible providers (OpenRouter, Ollama) via OpenAIProvider.

🛠️ Tool Patterns

  • Return Strings: Agents work best with text. Tools should return formatted strings, not Pydantic objects.
  • Resource Management: Initialize and cleanup DB connections properly within the tool or via injected deps.
  • Error Handling: Tools should catch exceptions and return helpful error messages to the agent rather than crashing.

📺 CLI & Streaming

  • Rich Integration: Use Rich to display real-time streaming of agent output and tool call details.
  • Node Handling: Implement logic for userprompt, modelrequest, call_tools, and end nodes in the CLI.
  • Transparency: Always show the user which tool is being called and with what parameters.