Getting Started
Create your first tool set, configure an agent, and run an objective.
This guide walks you through the core Cadenya workflow: creating a tool set, configuring an agent, and running an objective. By the end, you’ll have an agent executing a task using tools you’ve defined.
Create a tool set
Section titled “Create a tool set”Tool sets connect Cadenya to external tool providers. In this example, we’ll create a tool set that syncs tools from an MCP server.
Define the tool set
Section titled “Define the tool set”Create a tool set with an MCP adapter. The adapter tells Cadenya where to find tools and how to connect.
const toolSet = await client.toolSets.create({name: "My MCP Tools",description: "Tools synced from my MCP server",adapter: {mcp: {url: "https://your-mcp-server.example.com",},},});Cadenya connects to the MCP server and syncs the available tools into the tool set. You can view the synced tools by listing the tool set’s tools.
Create an agent
Section titled “Create an agent”Agents define behavior through variations. Each variation specifies a system prompt, a model, and which tools are available.
Create the agent with a variation
Section titled “Create the agent with a variation”Create an agent and include an initial variation that uses the tool set from the previous step.
const agent = await client.agents.create({name: "My First Agent",description: "An agent that uses my MCP tools",status: "published",default_variation: {name: "v1",prompt:"You are a helpful assistant. Use the tools available to you to complete the user's request.",model_config: {model_id: "claude/opus-4.6",temperature: 0.5,},agent_tools: [{tool_set: {tool_set_id: toolSet.metadata.id,},},],},});Setting
statusto"published"makes the agent immediately available for objectives. You can also create agents in"draft"status and publish them later.
Run an objective
Section titled “Run an objective”Objectives are where agents do work. You provide an initial message describing the task, and the agent executes it.
Create the objective
Section titled “Create the objective”const objective = await client.objectives.create({agent_id: agent.metadata.id,initial_message: "Summarize the latest data from my dashboard.",});The objective starts in a
pendingstate, transitions torunningas the agent begins work, and eventually reachescompletedorfailed.Check the result
Section titled “Check the result”Retrieve the objective to see its current status and execution details.
const result = await client.objectives.retrieve(objective.metadata.id);console.log(result.status.state); // "completed"You can also list events and tool calls to see exactly what the agent did during execution.
What’s next
Section titled “What’s next”Now that you’ve seen the full workflow, explore each concept in depth:
- Tool Sets — Adapters, tool management, and filtering
- Agents — Variations, lifecycle, and tool assignment
- Objectives — Monitoring, continuing, and providing feedback