Skip to content

API Reference parrot.tools.agent

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.agent

View source

Complete Fixed AgentTool with Correct Schema Structure

Alias AIMessage

Re-exported from parrot.models.responses.AIMessage.

Alias AbstractBot

Re-exported from parrot.bots.abstract.AbstractBot.

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Class AgentContext

Context passed between agents in orchestration.

Parameter Type Default Description
user_id str
session_id str
original_query str
conversation_history List[ConversationTurn] list()
shared_data Dict[str, Any] dict()
agent_results Dict[str, Any] dict()
metadata Dict[str, Any] dict()

Fields:

Field Type Default Description
user_id str
session_id str
original_query str
conversation_history List[ConversationTurn] field(default_factory=list)
shared_data Dict[str, Any] field(default_factory=dict)
agent_results Dict[str, Any] field(default_factory=dict)
metadata Dict[str, Any] field(default_factory=dict)

Alias AgentResponse

Re-exported from parrot.models.responses.AgentResponse.

Alias AgentResult

Re-exported from parrot.models.crew.AgentResult.

Class AgentTool

Wraps any BasicAgent/AbstractBot as a tool for use by other agents.

  • Schema includes "parameters" key for Google GenAI compatibility
  • Uses Pydantic args_schema for validation
  • Accepts all args as **kwargs in _execute()
Parameter Type Default Description
agent 'AbstractBot'
tool_name str None
tool_description str None
use_conversation_method bool True
context_filter Optional[Callable[[AgentContext], AgentContext]] None
execution_memory Optional[Any] None
**kwargs {}

Method AgentTool.get_schema

Return the tool schema in the format expected by Google GenAI.

get_schema() -> Dict[str, Any]

Returns: Dict[str, Any] — Schema with structure: { "name": "tool_name", "description": "...", "parameters": { # ← Google GenAI looks for this "type": "object", "properties": {...}, "required": [...] } }

Method AgentTool.get_usage_stats

Get usage statistics for this agent tool.

get_usage_stats() -> Dict[str, Any]

Returns: Dict[str, Any]

Alias ConversationTurn

Re-exported from parrot.memory.ConversationTurn.

Alias GrantDenied

Re-exported from parrot.roost.grant.GrantDenied.

Alias OutputMode

Re-exported from parrot.models.outputs.OutputMode.

Class QuestionInput

Input schema for AgentTool - defines the question parameter.

Fields:

Field Type Default Description
question str The question or task to ask the agent
mode Optional[Literal['replace', 'append']] 'replace' How to handle results: 'replace' overwrites previous results, 'append' concatenates
include_previous_results bool False When True, automatically inject all previous agent results as context into this agent call. Use this for cross-pollination where the current agent should build upon prior agent outputs.

Alias RoostEndpoint

Re-exported from parrot.roost.endpoint.RoostEndpoint.

Alias RoostFailure

Re-exported from parrot.roost.endpoint.RoostFailure.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally