Skip to main content

Agent Tools Reference

PydanticAI tools are registered based on the enabled_tools list in bot config. Each tool queries the database, builds A2UI components, and returns a text summary to the LLM.

Source: src/chatinbio/agent/tools/links.py

Lists active bio links. Renders A2UI cards with link title, description, and clickable buttons.

Triggered by: "What links do you have?", "Show me your links"

A2UI output: Column of Button components, one per active link.


products — list_products

Source: src/chatinbio/agent/tools/products.py

Lists active products with prices and purchase links.

Triggered by: "Do you have any courses?", "What products are available?"

A2UI output: List of Card components with title, description, price, and "Buy" button linking to external_url.


events — list_upcoming_events, create_rsvp

Source: src/chatinbio/agent/tools/events.py

list_upcoming_events

Lists active events with date, time, and description.

Triggered by: "Any upcoming events?", "What's happening?"

A2UI output: List of Card components with event details and "RSVP" button.

create_rsvp

Creates an RSVP record for an event. Collects name and email via A2UI form.

Parameters: event_id, name, email

A2UI output: Confirmation card with event details.


booking — list_available_slots, book_consultation

Source: src/chatinbio/agent/tools/booking.py

list_available_slots

Shows available consultation time slots.

Triggered by: "I'd like to book a call", "When are you available?"

A2UI output: List of available time slots with booking buttons.

book_consultation

Books a specific slot. Collects visitor details.

Parameters: slot_id, date, visitor_name, visitor_email

A2UI output: Confirmation card with booking details and (optionally) Google Meet link.


newsletter — subscribe_newsletter

Source: src/chatinbio/agent/tools/newsletter.py

Subscribes an email address to the newsletter.

Triggered by: "Subscribe me to updates", "I want to get your newsletter"

Parameters: email, name (optional)

A2UI output: Email input form, then confirmation card.


faq — search_faq

Source: src/chatinbio/agent/tools/faq.py

Searches FAQ entries by keyword matching against questions and answers.

Triggered by: "What tech stack do you use?", specific questions about the owner

Parameters: query

Returns: Matching FAQ entries as text context for the LLM to formulate a response. Optionally renders FAQ cards.


portfolio — show_portfolio

Source: src/chatinbio/agent/tools/portfolio.py

Lists active portfolio items.

Triggered by: "Show me your work", "What projects have you built?"

A2UI output: List of Card components with title, description, image, and "View" button.


Tool registration

Tools are conditionally registered in src/chatinbio/agent/factory.py:

enabled_tools = json.loads(bot_config.enabled_tools)
# e.g., ["links", "products", "faq"]

# Only tools in enabled_tools are registered on the agent
# Unknown tool names are silently ignored

Writing custom tools

To add a new tool:

  1. Create src/chatinbio/agent/tools/your_tool.py
  2. Define an async function with RunContext[ChatDeps] parameter
  3. Query DB via ctx.deps.db_session
  4. Build A2UI via ctx.deps.surface_manager.create_builder()
  5. Return a text summary string
  6. Register it in factory.py's tool_registry dict