Skip to main content
FrontMCP agents are autonomous units that can invoke tools using LLM reasoning. This guide shows you how to create agents that combine LLM capabilities with your MCP tools.
Prerequisites:
  • A working FrontMCP project with tools (see Your First Tool)
  • An API key for an LLM provider (OpenAI, Anthropic, etc.)

What You’ll Build

A weather summary agent that:
  • Accepts a location from the user
  • Uses a weather tool to fetch current conditions
  • Returns a human-friendly summary generated by an LLM

Understanding Agents

Agents in FrontMCP are different from tools:

Step 1: Create a Tool for the Agent

First, create a tool that the agent can use:

Step 2: Create the Agent


Step 3: Register the Agent

Add the agent to your app:

Agent Configuration Options

LLM Provider Configuration

Tool Visibility

Control how the agent appears to clients:

System Instructions

Guide the agent’s behavior:

How Agents Work

1

Request received

User calls the agent with input matching inputSchema.
2

LLM processes request

The agent sends the input to the configured LLM along with:
  • System instructions
  • Available tools (as function definitions)
  • User input
3

Tool calls (if needed)

If the LLM decides to use a tool, the agent:
  1. Executes the tool with provided arguments
  2. Returns the result to the LLM
  3. LLM continues reasoning
4

Response generated

The LLM generates a final response matching outputSchema.

Example: Multi-Tool Agent

Create an agent that uses multiple tools:

Example: Planning Agent

Create an agent that breaks down complex tasks:

Using Agents as Tools

Agents can be used by other agents, creating hierarchical workflows:

Testing Agents


Best Practices

Good instructions lead to better agent behavior:
Only give agents tools they need:
Help LLMs produce structured output:
Include error handling in system instructions:
Track LLM API usage:

Next Steps

Agent Reference

Full @Agent decorator documentation

CodeCall Plugin

Advanced agent orchestration

Tool UI

Rich displays for agent outputs

Testing

Test agents and their tool usage