Skip to content

AgentConfig


AgentForceAgent Configuration Required

The AgentConfig type defines the configuration object used to initialize an AgentForceAgent instance. It provides the foundational settings that define the agent’s identity, capabilities, logging behavior, and MCP (Model Context Protocol) integration.

export type AgentConfig = {
name: string;
tools?: ToolType[];
skills?: string[];
mcps?: string[];
mcpConfig?: string;
assetPath?: string;
logger?: AgentForceLogger;
};
Property
Type
Requirement
Description
name
string
Required
Unique identifier for the agent. Used for logging and identification purposes.
tools
ToolType[]
Optional
Array of tools that the agent can utilize during execution. Tools extend the agent's capabilities beyond text generation.
skills
string[]
Optional
Array of skill file paths that define the agent's specialized abilities or knowledge domains.
mcps
string[]
Optional
Array of MCP (Model Context Protocol) server names to connect to. Supports both local command-based servers and remote SSE/HTTP servers. Enables interaction with external tools and resources through MCP servers.
mcpConfig
string
Optional
Path to agent-specific MCP configuration file. Supports both local and remote (SSE/HTTP) server configurations. Overrides global mcp.config.json for this agent instance.
assetPath
string
Optional
Base path for agent assets (skills, templates, etc.). Supports both relative and absolute paths. Defaults to current working directory if not specified.
logger
AgentForceLogger
Optional
Custom logger instance for controlling how the agent logs its operations and debug information.
import { AgentForceAgent } from '@agentforce/adk';
const config = {
name: "CodeHelper"
};
const agent = new AgentForceAgent(config);
import { AgentForceAgent, type AgentConfig } from '@agentforce/adk';
const config: AgentConfig = {
name: "DataAnalyst",
tools: ["fs_read_file", "fs_write_file", "web_fetch"]
};
const agent = new AgentForceAgent(config);
import { AgentForceAgent, type AgentConfig } from '@agentforce/adk';
const config: AgentConfig = {
name: "GitAgent",
mcps: ["github", "filesystem", "agentforce-adk-docs"], // MCP server names (local and remote)
mcpConfig: "agents/my-mcp-config.json", // Agent-specific MCP config with SSE servers
tools: ["fs_read_file"]
};
const agent = new AgentForceAgent(config);
import { AgentForceAgent, type AgentConfig } from '@agentforce/adk';
import type { ModelConfig } from '@agentforce/adk';
const config: AgentConfig = {
name: "IntegrationAgent",
skills: ["product-owner"],
tools: ["fs_read_file"],
assetPath: "./agents/integration", // Custom asset path
};
const modelConfig: ModelConfig = {
temperature: 0.7,
maxTokens: 8192,
}
// Create and configure your agent
const IntegrationAgent = new AgentForceAgent(config)
.useLLM("openrouter", "moonshotai/kimi-k2", modelConfig)
.prompt(`Create a user story for the Game Development Marketplace website project initialization.`)
await IntegrationAgent.saveToFile("examples/files/responses/integration-agent.md");
import { AgentForceAgent, type AgentConfig } from '@agentforce/adk';
const config: AgentConfig = {
name: "AdvancedAssistant",
tools: ["fs_read_file", "fs_write_file", "web_fetch"],
skills: ["programming", "data-analysis", "documentation"],
mcps: ["github", "filesystem"],
mcpConfig: "configs/advanced.mcp.json",
assetPath: "./assets/advanced-assistant",
logger: customLogger
};
const agent = new AgentForceAgent(config);

The name property serves as a unique identifier for your agent instance. This value is:

  • Required for all agent configurations
  • Used in logging output to distinguish between multiple agents
  • Helpful for debugging and monitoring agent behavior
  • Should be descriptive of the agent’s purpose or role

The tools array enables your agent to perform actions beyond text generation:

  • Each tool extends the agent’s capabilities
  • Tools are executed when the agent determines they’re needed
  • Common tool types include file operations, web searches, calculations, and API calls
  • Tools are optional but greatly enhance agent functionality

The skills array defines specialized knowledge domains or abilities:

  • Contains file paths to skill documents that will be automatically loaded
  • Skills are added to the agent’s system prompt during execution
  • Helps the LLM understand what tasks it should focus on
  • Can influence how the agent approaches problems
  • Files are loaded from the agent’s asset path

The mcps array specifies MCP (Model Context Protocol) servers to connect to:

  • Each string corresponds to a server name defined in your MCP configuration
  • Supports both local (command-based) and remote (SSE/HTTP) servers
  • Enables interaction with external tools, resources, and data sources
  • Servers are automatically connected during agent execution
  • Tools from MCP servers become available to the agent
  • Supports a growing ecosystem of MCP-compatible services including remote documentation servers

The mcpConfig property allows agent-specific MCP configuration:

  • Path to a JSON configuration file for MCP servers
  • Supports both local and remote (SSE/HTTP) server configurations
  • Overrides the global mcp.config.json for this agent instance
  • Useful for agents with specialized MCP requirements
  • Supports environment variable substitution using ${VAR_NAME} syntax
  • File is loaded automatically when the agent initializes
  • Can include type, url, and other SSE-specific properties

The assetPath property defines where agent assets are located:

  • Base directory for skills, templates, and other agent resources
  • Supports both relative and absolute paths
  • Defaults to current working directory if not specified
  • Can be overridden by AGENT_ASSETS_PATH environment variable
  • All relative paths in skills and templates are resolved from this base

The logger property allows custom logging configuration:

  • Controls how agent operations are logged
  • Useful for debugging and monitoring
  • Can specify log levels, formats, and outputs
  • If not provided, a default logger is used
  1. Naming: Use descriptive, unique names that reflect the agent’s purpose
  2. Tools: Only include tools that are relevant to your agent’s intended tasks
  3. Skills: Be specific about skills to help guide the agent’s behavior
  4. MCP Integration: Use MCP servers to extend capabilities without custom tool development
  5. Asset Organization: Use consistent asset paths and directory structures
  6. Logging: Use custom loggers in production for better observability
  • ToolType: Defines the structure for agent tools
  • AgentForceLogger: Interface for custom logging implementations
  • AgentForceAgent: The main class that uses this configuration
  • MCPServerConfig: Configuration structure for MCP servers
  • ModelConfig: Configuration for model parameters