Agent skill · AI & Agents

pydantic-ai-tool-system

Register and implement PydanticAI tools with proper context handling, type annotations, and docstrings. Use when adding tool capabilities to agents, implementing function calling, or creating agent actions.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill pydantic-ai-tool-system --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Path: skills/agent/pydantic-ai-tool-system/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# PydanticAI Tool System ## Tool Registration Two decorators based on whether you need context: ```python from pydantic_ai import Agent, RunContext agent = Agent('openai:gpt-4o') # @agent.tool - First param MUST be RunContext @agent.tool async def get_user_data(ctx: RunContext[MyDeps], user_id: int) -> str: """Get user data from database. Args: ctx: The run context with dependencies. user_id: The user's ID. """ return await ctx.deps.db.get_user(user_id) # @agent.tool_plain - NO context parameter allowed @agent.tool_plain def calculate_total(prices: list[float]) -> float: """Calculate total price. Args: prices: List of prices to sum. """ return sum(prices) ``` ## Critical Rules 1. **@agent.tool**: First parameter MUST be `RunContext[DepsType]` 2. **@agent.tool_plain**: MUST NOT have `RunContext` parameter 3. **Docstrings**: Required for LLM to understand tool purpose 4. **Google-style docstrings**: Used for parameter descriptions ### Gates (verify in the file, not from memory) 1. **Decorator matches signature** — If the first parameter is `RunContext[...]`, the decorator must be `@agent.tool` (not `@agent.tool_plain`). **Pass:** the same `def` line’s decorator stack includes `@agent

What's inside
Steps it walks through
  1. Tool Registration
  2. Critical Rules
  3. Gates (verify in the file, not from memory)
  4. Docstring Formats
  5. Tool Return Types
  6. Accessing Context
  7. Tool Prepare Functions
  8. Toolsets
  9. Common Mistakes
  10. Wrong: Context in toolplain
  11. Wrong: Missing context in tool
  12. Wrong: Context not first parameter
  13. Async vs Sync
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the pydantic-ai-tool-system skill do?

Register and implement PydanticAI tools with proper context handling, type annotations, and docstrings. Use when adding tool capabilities to agents, implementing function calling, or creating agent actions.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill pydantic-ai-tool-system --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going