Skip to main content

Tools

Tools give agents the ability to act -- search the web, browse pages, query APIs, and connect to external services. Tools are managed separately from agents and attached by their integer IDs.

How Tools Work​

The tool workflow has four steps:

Browse Catalog  →  Add Tool  →  Configure  →  Attach to Agent
  1. Browse the catalog to see what tools are available
  2. Add a tool from the catalog to your account
  3. Configure it with any required credentials or settings
  4. Attach it to one or more agents by passing its integer ID

Tool Catalog​

The catalog lists all tools available on the platform. Each entry has a name, type, title, description, and categories.

from flymyai import AgentClient

client = AgentClient(api_key="fly-***")

catalog = client.tools.available()

for tool in catalog:
print(f"{tool.name} ({tool.type})")
print(f" {tool.title}: {tool.description}")
print(f" Categories: {tool.categories}")

AvailableTool Fields​

FieldTypeDescription
namestringIdentifier used when creating the tool (e.g. "tavily")
typestringTool type
titlestringHuman-readable display name
descriptionstringWhat the tool does
categorieslistGroupings for browsing (e.g. search, browser, data)

Adding a Tool​

Create a tool instance from the catalog using its name (passed as mcp_tool). This returns a Tool object with an integer .id.

tool = client.tools.create(mcp_tool="tavily")

print(f"Tool ID: {tool.id}") # integer ID
print(f"MCP Tool: {tool.mcp_tool}") # "tavily"
print(f"Configured: {tool.is_configured}")

Tool Fields​

FieldTypeDescription
idintUnique identifier used when attaching to agents
mcp_toolstringThe catalog tool name
is_configuredboolWhether all required configuration has been provided
next_configuration_stepdict or NoneDescribes the next required configuration input, if any

Configuring a Tool​

Some tools require configuration (API keys, credentials, or other settings). When is_configured is false, inspect next_configuration_step and provide the required values.

tool = client.tools.create(mcp_tool="tavily")

# Check what configuration is needed
if not tool.is_configured:
print(f"Next step: {tool.next_configuration_step}")

# Provide the required configuration
tool = client.tools.provide_config(
tool.id,
user_response={"TAVILY_API_KEY": "tvly-***"}
)

print(f"Now configured: {tool.is_configured}")
Multi-step configuration

Some tools may require multiple configuration steps. After each call to provide_config, check is_configured and next_configuration_step again. Repeat until is_configured is true.

Attaching Tools to Agents​

Pass tool IDs as a list of integers when creating or updating an agent:

# Create tools
tavily = client.tools.create(mcp_tool="tavily")
tavily = client.tools.provide_config(tavily.id, user_response={"TAVILY_API_KEY": "tvly-***"})

browser = client.tools.create(mcp_tool="browser")

# Create agent with tools attached
agent = client.agents.create(
name="Research Assistant",
goal="Research the given topic and produce a detailed summary with sources.",
tools=[tavily.id, browser.id]
)

# Or update an existing agent's tools
client.agents.update(
agent_id=agent.id,
tools=[tavily.id, browser.id]
)

Calling Tools Directly​

You can invoke a tool directly without an agent, which is useful for testing or one-off operations:

result = client.tools.call(
tool.id,
action="search",
arguments={"query": "latest AI research papers"}
)

print(result)

Complete Example​

End-to-end flow: browse catalog, add tools, configure, create agent, run it.

from flymyai import AgentClient

client = AgentClient(api_key="fly-***")

# 1. Browse the catalog
catalog = client.tools.available()
for t in catalog:
print(f" {t.name}: {t.description}")

# 2. Add tools
tavily = client.tools.create(mcp_tool="tavily")
browser = client.tools.create(mcp_tool="browser")

# 3. Configure tools that need it
tavily = client.tools.provide_config(
tavily.id,
user_response={"TAVILY_API_KEY": "tvly-***"}
)

# 4. Create an agent with tools attached
agent = client.agents.create(
name="Market Researcher",
goal="Research current market trends and produce a structured analysis.",
tools=[tavily.id, browser.id],
status="active"
)

# 5. Run the agent
run = client.runs.create(agent_id=agent.id)
result = client.runs.wait(run.id, timeout=300)

print(f"Status: {result.status}")
print(f"Output: {result.output}")

Next Steps​

  • Agents -- create agents and attach tools
  • Runs -- execute agents and monitor progress