AgentConfig
AgentConfig
Section titled “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.
Type Definition
Section titled “Type Definition”export type AgentConfig = { name: string; tools?: ToolType[]; skills?: string[]; mcps?: string[]; mcpConfig?: string; assetPath?: string; logger?: AgentForceLogger;};
Properties
Section titled “Properties”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.
Usage Examples
Section titled “Usage Examples”Basic Configuration
Section titled “Basic Configuration”import { AgentForceAgent } from '@agentforce/adk';
const config = { name: "CodeHelper"};
const agent = new AgentForceAgent(config);
Configuration with Tools
Section titled “Configuration with Tools”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);
Configuration with MCP Integration
Section titled “Configuration with MCP Integration”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);
Real-World Example
Section titled “Real-World Example”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 agentconst 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");
Complete Configuration
Section titled “Complete Configuration”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);
Property Details
Section titled “Property Details”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
skills
Section titled “skills”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
mcpConfig
Section titled “mcpConfig”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
assetPath
Section titled “assetPath”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
logger
Section titled “logger”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
Best Practices
Section titled “Best Practices”- Naming: Use descriptive, unique names that reflect the agent’s purpose
- Tools: Only include tools that are relevant to your agent’s intended tasks
- Skills: Be specific about skills to help guide the agent’s behavior
- MCP Integration: Use MCP servers to extend capabilities without custom tool development
- Asset Organization: Use consistent asset paths and directory structures
- Logging: Use custom loggers in production for better observability
Related Types
Section titled “Related Types”ToolType
: Defines the structure for agent toolsAgentForceLogger
: Interface for custom logging implementationsAgentForceAgent
: The main class that uses this configurationMCPServerConfig
: Configuration structure for MCP serversModelConfig
: Configuration for model parameters