Editing an agent

Edit an agent in Cloudera Agent Studio to update instructions, files, sub-agents, tools, MCP servers, skills, and guardrail.

The agent editor opens a working copy of the agent in your workspace. The editor has the following areas:

  • The header shows the name of the agent, the Save, Test, and Validate buttons, and the stages of authoring: Build, Validate, Test, and Publish.
  • The Files pane on the left shows the files of the agent in a tree. The root folder has the name of the agent and contains the agents, skills, and tools folders, and the AGENTS.md, config.json, and mcp.json files.
  • The main area has the Canvas and Structure tabs, and one tab for each file that you open. The canvas shows the agent with its sub-agents, tools, MCP servers, and skills.

An agent uses the following layout in the workspace:

Table 1. Agent layout in the workspace
Path Purpose
agents/name/config.json Agent configuration.
agents/name/AGENTS.md Agent prompt.
agents/name/mcp.json MCP server entries for the agent.
agents/name/agents/helper.md A sub-agent (helper), with name and description in the front matter.
agents/name/tools/tool/ A tool folder in MCPB format, with a manifest.json file.
agents/name/skills/skill/SKILL.md A skill.

Edits to files save automatically to your session shortly after you stop typing. Automatic saves do not create a draft or a version. Save a draft or publish the agent to keep your changes in the catalog. For more information, see Saving drafts and publishing an agent to the catalog.

  1. Launch the Cloudera Agent Studio console.
  2. In the left navigation pane, click Assets > Agent Catalog.
    The Agents page is displayed.
  3. In the row of the agent, click the Actions menu, and then click Edit.
    If an authoring session is not ready, a progress dialog opens while the session starts. Wait for the dialog to close. The agent editor opens on the Canvas tab.
To change a file:
  1. In the Files pane, expand a folder and click a file name.
    The file opens in a tab next to the Canvas and Structure tabs. For a sub-agent file, a Sub-agent tag appears above the code. The sub-agent description tells the main agent when to hand work to the sub-agent, and the text below the description contains the sub-agent's instructions.
  2. Click in the code editor, and make your changes.
    The editor saves your changes to your workspace automatically.
  3. To close the file, click Close on its tab.

    To search for a file, type in the Search files box at the top of the Files pane.

    To collapse the Files pane, click « at the bottom of the pane. To expand the pane, click ».

To add a file or a folder:
  1. In the Files pane, navigate to the agent folder and click File actions.
  2. Click New file or New folder.
    The New file or New folder dialog box is displayed.
  3. In Name, enter a name. The name cannot be empty or contain /.
  4. Optional: To upload an existing file instead of creating an empty file, select Upload a file, and then select the file. For a folder, select Upload a .tar.gz bundle.
  5. Click Create.
    The message Created "name" is displayed.
To rename or delete a file or a folder:
  1. In the Files pane, point to the file or the folder, and click File actions.
  2. Click Rename or Delete, and then follow the prompts in the dialog.
    After a rename, the message Renamed to "name" is displayed.
To add a sub-agent:
  1. Click Add > Sub-agent.
    The New sub-agent dialog box is displayed.
  2. In the Write it here tab, enter the Name, Description, and Prompt for the agent in the respective fields.
  3. Optional: In the Upload a .md file tab, select Drop a .md subagent file here and upload a markdown file from your system to attach an existing subagent.
  4. Click Create, or, for an uploaded file, click Upload.
    The message Created "name" successfully or Uploaded "name" successfully is displayed, and the sub-agent appears on the canvas.
To add a tool:
  1. Click Add > Tool.
    The Add tools dialog box is displayed.
  2. Select a published version of the tool from the list and click Add tool.
  3. If there are no published versions of the tools, click New Tool.
  4. Enter a tool name.
  5. Click Create.
    The tool is attached to the agent.
To add a skill:
  1. Click Add > Skill.
    The Add skills dialog box is displayed.
  2. Select a published version of the skill from the list and click Add skill.
  3. If there are no published versions of the tools, click New skill.
  4. Enter a Name, Description and Prompt for the skill.
  5. Click Create.
    The skill is attached to the agent.
To add an MCP server:
  1. Click Add > MCP server.
    The Add new MCP server dialog box is displayed.
  2. In MCP server name, enter a DNS-safe name.
  3. In Type, select the type of the server.
    • For a remote server, keep the default type streamable_http, and enter the address of the server in URL.
    • For a server that runs from a package, select Package — Python or Package — Node. In Package, enter the name of the package. In Arguments, enter up to 100 arguments.
  4. Optional: Under Environment variables (optional), enter a Key and a Value, and then click Add.
  5. Click Add MCP server.
    The message Added MCP server "name" to "agent-name" is displayed.
To configure a guardrail:
  1. For instructions to configure a guardrail, see Configuring guardrails for an agent.
To detach a tool, an MCP server, a skill, or a sub-agent:
  1. In the Files pane, click More actions.
  2. Click Detach tool, Detach MCP, Detach skill, or Detach sub agent.
    The Detach dialog box is displayed.
  3. In the Select list, select the item to detach.
  4. Click Detach tool, Detach MCP server, Detach skill, or Detach sub agent in the dialog box.
    The message Detached "name" successfully appears. Agent Studio writes your pending edits before it detaches the item.
To validate, test, and save the agent:
  1. Click Validate to check the agent for problems.
    For instructions, see Validating an agent.
  2. Click Test to open a harness chat with your working copy.
    For instructions, see Testing an agent.
  3. Click Save, and then click Save as draft to keep your changes private, or Publish to catalog to share the agent.
To rename the agent, reload its files, or delete its working copy:
  1. In the agent header, click More actions.
  2. Click one of the following items:
    • Rename: In Rename dialog box, enter a DNS-safe name and click Rename. If you published the agent under its old name, saving the next version publishes it as a new, separate catalog entry instead of a new version of the original agent.
    • Reload files: The Files pane reads the files from your workspace again.
    • Delete working copy…: In the Delete agent dialog box, click Delete to confirm. The agent and all its files are permanently removed from the authoring plane, and catalog entries are not affected.
To leave the editor:
  1. Click Back to catalog in the agent header.
    Agent Studio saves your changes as a draft, removes the working copy from your workspace, and returns to the Agent Catalog page.

Your changes remain in your workspace until you save a draft or publish the agent to add them to the catalog.