StudioTools

Let an agent create, edit, run, and version AgentOS Studio components.

StudioTools gives an agent access to Studio component operations. The agent can inspect the Registry, create agents, teams, and workflows, edit Studio-created components, preview and publish them, archive or restore them, and manage versions.

Use it for builder agents that turn natural language into AgentOS components.

Prerequisites

The following example requires the openai, anthropic, ddgs, and sqlalchemy libraries.

uv pip install agno openai anthropic ddgs sqlalchemy

The Agent model uses an OpenAI key, separately from any toolkit provider credentials.

Set OpenAI Key

Set your OPENAI_API_KEY as an environment variable. You can get one from OpenAI.

export OPENAI_API_KEY=sk-***

The registered Claude model additionally needs ANTHROPIC_API_KEY when selected for a component. The example creates a draft; publishing is a separate operation.

Example

cookbook/05_agent_os/22_studio/studio_tools_agent.py
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic import Claude
from agno.models.openai import OpenAIResponses
from agno.registry import Registry
from agno.tools.calculator import CalculatorTools
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.hackernews import HackerNewsTools
from agno.tools.studio import StudioTools

db = SqliteDb(id="studio-db", db_file="tmp/studio.db")

registry = Registry(
    name="Studio Registry",
    tools=[DuckDuckGoTools(), HackerNewsTools(), CalculatorTools()],
    models=[
        OpenAIResponses(id="gpt-5.5"),
        Claude(id="claude-sonnet-4-6"),
    ],
    dbs=[db],
)

greeter = Agent(
    id="greeter",
    name="Greeter",
    model=OpenAIResponses(id="gpt-5.5"),
    instructions=["You are a friendly greeter."],
    db=db,
)

reporter = Agent(
    id="reporter",
    name="Reporter",
    model=OpenAIResponses(id="gpt-5.5"),
    instructions=["You summarize news headlines in 2-3 sentences."],
    db=db,
)

studio_agent = Agent(
    id="studio-agent",
    name="Studio Agent",
    model=OpenAIResponses(id="gpt-5.5"),
    tools=[
        StudioTools(
            registry=registry,
            db=db,
            include_agents=[greeter, reporter],
            default_model_id="gpt-5.5",
            versions=True,
        )
    ],
    instructions=[
        "List available models and tools before creating components.",
        "Use exact Registry tool names.",
        "Return the component id, version, publication status, and next action.",
    ],
    db=db,
    markdown=True,
)

studio_agent.print_response(
    "Create an agent named paper-review-assistant that finds research papers."
)

Toolkit Params

ParameterTypeDefaultDescription
registryRegistryrequiredModels, tools, functions, knowledge, schemas, learning configurations and code-defined components available for composition.
dbOptional[BaseDb]first Registry DBComponent persistence; the Registry fallback is resolved lazily.
include_agentsOptional[list[Agent]]NoneCode-defined agents available alongside stored components.
include_teamsOptional[list[Team]]NoneCode-defined teams available for composition.
include_workflowsOptional[list[Workflow]]NoneCode-defined workflows available for discovery and execution.
default_model_idOptional[str]NoneModel used when a create call omits it.
default_num_history_runsOptional[int]NoneHistory depth for created agents and teams when omitted by the caller.
create_agentsboolTrueExpose agent create, edit and run tools.
create_teamsboolTrueExpose team create, edit and run tools.
create_workflowsboolTrueExpose workflow create, edit and run tools.
versionsboolTrueCreate drafts and expose version tools; False publishes changes immediately.
schedulesboolFalseExpose schedule tools; install agno[scheduler] and run the AgentOS scheduler for execution.
list_limitint100Maximum stored components returned by a list tool; db_total reports the total.
allowed_toolsOptional[list[str]]NoneAdditional tool or control-plane component names allowed for composition.
denied_toolsOptional[list[str]]NoneNames excluded from composition; denials take precedence.
max_dispatch_depthint2Maximum nested dispatch hops; 0 disables dispatch.
self_dispatchLiteral["never", "once"]"never"Whether one bounded self-run is allowed.

Toolkit Functions

GroupFunctions
Discoverylist_models, list_tools, list_functions, list_knowledge, list_schemas, list_learning, list_components, get_component
Agentscreate_agent, edit_agent, run_agent
Teamscreate_team, edit_team, run_team
Workflowscreate_workflow, edit_workflow, run_workflow
Component lifecyclevalidate_component, archive_component, restore_component
Versions (versions=True)list_versions, publish_component, set_current_version, delete_version
Schedules (schedules=True)create_schedule, update_schedule, list_schedules, get_schedule, get_schedule_runs, trigger_schedule, enable_schedule, disable_schedule, delete_schedule

Discovery and component lifecycle tools remain available independently of the three creation flags.

Drafts, publication and ownership

  • Creation and edits produce drafts by default. Pass publish=True or call publish_component to publish a version. Drafts can be previewed with a version-specific run but do not serve ordinary users or schedules.
  • set_current_version selects an already published version. archive_component retires a component while retaining its ID and history; restore_component reverses that operation. Only unpublished drafts can be deleted.
  • When RunContext.user_id is set, created components belong to that caller. Publishing makes them readable and runnable by other users; mutations remain owner-scoped. Without a caller identity, Studio skips these ownership and draft-visibility checks. The local example above uses this unscoped operator behavior; supply a user identity when serving individual users.
  • Code-defined components can be discovered and reused. Studio does not edit their Python definitions or automatically persist their members.
  • Declared Registry tools are buildable. Tools discovered from existing AgentOS components need an explicit palette grant to become buildable; denied_tools overrides grants.
  • Confirmation defaults cover archive_component, delete_version, and delete_schedule. Configure requires_confirmation_tools to change this selection, and handle paused runs with HITL.

Developer Resources