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 sqlalchemyThe 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
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
| Parameter | Type | Default | Description |
|---|---|---|---|
registry | Registry | required | Models, tools, functions, knowledge, schemas, learning configurations and code-defined components available for composition. |
db | Optional[BaseDb] | first Registry DB | Component persistence; the Registry fallback is resolved lazily. |
include_agents | Optional[list[Agent]] | None | Code-defined agents available alongside stored components. |
include_teams | Optional[list[Team]] | None | Code-defined teams available for composition. |
include_workflows | Optional[list[Workflow]] | None | Code-defined workflows available for discovery and execution. |
default_model_id | Optional[str] | None | Model used when a create call omits it. |
default_num_history_runs | Optional[int] | None | History depth for created agents and teams when omitted by the caller. |
create_agents | bool | True | Expose agent create, edit and run tools. |
create_teams | bool | True | Expose team create, edit and run tools. |
create_workflows | bool | True | Expose workflow create, edit and run tools. |
versions | bool | True | Create drafts and expose version tools; False publishes changes immediately. |
schedules | bool | False | Expose schedule tools; install agno[scheduler] and run the AgentOS scheduler for execution. |
list_limit | int | 100 | Maximum stored components returned by a list tool; db_total reports the total. |
allowed_tools | Optional[list[str]] | None | Additional tool or control-plane component names allowed for composition. |
denied_tools | Optional[list[str]] | None | Names excluded from composition; denials take precedence. |
max_dispatch_depth | int | 2 | Maximum nested dispatch hops; 0 disables dispatch. |
self_dispatch | Literal["never", "once"] | "never" | Whether one bounded self-run is allowed. |
Toolkit Functions
| Group | Functions |
|---|---|
| Discovery | list_models, list_tools, list_functions, list_knowledge, list_schemas, list_learning, list_components, get_component |
| Agents | create_agent, edit_agent, run_agent |
| Teams | create_team, edit_team, run_team |
| Workflows | create_workflow, edit_workflow, run_workflow |
| Component lifecycle | validate_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=Trueor callpublish_componentto publish a version. Drafts can be previewed with a version-specific run but do not serve ordinary users or schedules. set_current_versionselects an already published version.archive_componentretires a component while retaining its ID and history;restore_componentreverses that operation. Only unpublished drafts can be deleted.- When
RunContext.user_idis 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_toolsoverrides grants. - Confirmation defaults cover
archive_component,delete_version, anddelete_schedule. Configurerequires_confirmation_toolsto change this selection, and handle paused runs with HITL.