Creating and Managing Agents
Create your own agent for Qodo Gen CLI to use, then run Qodo Gen CLI with a customizable command.
1. Create an agent file
Before starting to use Qodo Gen CLI, make sure you've logged in to Qodo.
Create a file <your-command-name-here>.toml
and save it under a folder called agents
.
2. Customize your agent
Follow the skeleton and customize your agent to your needs. You can set instructions, import existing agents configurations for your agent to use, and give it tools to utilize.
Name your agent file after the command you want to use to run it. This name should also appear in the file itself, under the commands
section.
The fields of the agent file are:
description
string
Description of what your agent does
instructions
string
Prompt for the AI models explailing the required behavior
arguments
list of objects
List of possible arguments that can be given to the agent.
The arguments will be translated and forwarded to MCP servers.
mcpServers
string
List of MCP servers used by the agent
available_tools
list
List of MCP server names
execution_strategy
"act" or "plan"
Plan lets the agent think through a multi-step strategy, act executes actions immediately
output_schema
string
Valid json of the wanted agent output
exit_expression
string
For CI runs, a condition used to determine if the agent run succeeded or failed
Example agent TOML file
3. Set output type
You can give your agent a json
schema to follow as its output.
If there’s no output schema given, your agent will output a textual summary as a reply for a query.
4. Create an agent.toml
file
agent.toml
fileAdd your agent to a file called agent.toml
. This file will hold all agent files that Qodo Gen CLI will know and be able to call.
Example agent.toml
file:
5. Use your agent
You can now run your agent by calling:
mcp.json
file
mcp.json
fileYou can define MCP servers to be used by agents in a file called mcp.json
. This will make the MCP servers available to all agents you're configuring.
Once configured in the mcp.json
file, these tools can be mentioned under the available_tools
section in your agent file to be used by your agent.
If you want a specific MCP server for your agent that doesn't need to be reused for other agents, you can define it in the specific agent configuration TOML file.
Agent Modes
Agent as server: the --mcp
flag
--mcp
flagYou can also run an agent as a tool server:
This launches the agent as a service listening on port 3000
.
The service can be integrated with other AI tools or exposed via URL.
You can exit at any time by pressing Escape
.
Qodo and Community Agent Examples
Check out Qodo's agent repository in GitHub to see examples of working agents.
Last updated
Was this helpful?