Practical Guide to AI Agent Tools: Tools, MCP, and Skills
This guide explains how AI agents use tools, MCP services, and reusable Skills to complete engineering tasks. It covers agent architecture, common operating modes, configuration patterns, and the security and troubleshooting practices required for enterprise environments.
Large language models struggle to complete complex engineering tasks through text conversation alone. A commonly used simplified formula is:
Agent = LLM + prompts + tools
This formula is a practical starting point for agent engineering. Models may need to query databases, call APIs, read files, or write files, but all of these operations must be constrained. This article focuses on three areas: the basic architecture and preset modes of AI agents, configuration methods for three types of extensions, and security and troubleshooting considerations for enterprise tool usage.
1. AI Agent Architecture
The basic configuration of an agent platform usually includes three components.
Permission policies define what an agent can and cannot do. They determine whether the agent can write to a specific directory, execute certain commands, or access a particular network address. Permissions should start with the narrowest practical scope and be expanded only when necessary.
Model access allows the underlying model to be replaced. Models can differ significantly in reasoning ability, response speed, and per-call cost. Lightweight models may be sufficient for simple tasks, while more capable models can be selected for complex refactoring.
The plugin system provides a unified extension interface, allowing tools, MCP services, and Skills to be attached to the same agent.
Common Agent Modes
Most platforms provide several operating modes. Names and details vary by product, but the following table summarizes common characteristics.
| Mode | Typical use cases | Context and cost | Main risk | Recommended permissions |
|---|---|---|---|---|
| Standard mode | Code generation, logic analysis, and routine modifications | Medium | The agent may overlook details when the task scope is too broad | Restrict access to the project directory |
| Minimal mode | Single-file questions or isolated changes | Low | Limited context may lead to incorrect assumptions about dependencies | Read-only access or write access to a single file |
| Domain-specific mode | Business workflows that depend on specialized knowledge bases | Depends on knowledge-base size | Knowledge may become outdated or fail to cover all rules | Grant permissions separately for each business workflow |
| Feedback-adjustment mode | Repeated debugging and tasks that benefit from accumulated experience | Relatively high | The strategy may drift from the intended behavior | Require human approval for every strategy change |
Feedback-adjustment mode changes its next action based on execution results, such as whether tests passed or what error messages were returned. It can also record effective experience for future use. This reduces repeated trial and error, but humans should review these records before they become long-term rules. Otherwise, incorrect experience may be reused repeatedly.
2. Connecting Tools
Tool integration is the most direct way to extend an agent. Developers describe a tool’s name, purpose, and parameters using JSON Schema. The model then determines when the tool should be called.
The following example defines a weather lookup tool:
{"name": "get_weather","description": "Get today's weather for a specified city. Use this tool when the user asks whether they need an umbrella or what clothes to wear.","input_schema": {"type": "object","properties": {"city": {"type": "string","description": "City name, for example: Beijing"}},"required": ["city"]}}
Field names vary across platforms. For example, some platforms use parameters instead of input_schema. Follow the documentation for the platform you are using.
The description should clearly explain the tool’s purpose. Otherwise, the model may call it incorrectly or fail to call it when needed. Keep only the required parameters, and document the meaning and format of every field.
3. Configuring MCP Services
MCP stands for Model Context Protocol. It defines a standardized way for models to connect to external tools and data sources. After an MCP service is integrated, an agent can read resources or call functions through a unified protocol, without requiring a separate adapter for every system.
Configuration usually includes the service name, startup command, and arguments. The following is a common configuration structure; exact field names depend on the client:
{"mcpServers": {"internal-db": {"command": "npx","args": ["-y", "your-mcp-server-package"],"env": {"DB_READONLY_URL": "${DB_READONLY_URL}"}}}}
Keep the following points in mind:
- Store connection strings, tokens, and other secrets in environment variables or a secrets management service. Do not place them directly in configuration files.
- Use read-only accounts for database services whenever possible.
- Validate the integration in a test environment first, and confirm that the returned data is within the intended scope.
- Record the service version and complete regression testing in the test environment before upgrading.
When troubleshooting, follow this order: first verify that the service can start independently on the local machine; then confirm that the client can list the tools provided by the service; finally inspect the parameters and returned content of the specific call.
4. Writing Skills
A Skill packages a fixed, multi-step workflow into a reusable module. For example, the steps for pulling code, installing dependencies, building the project, and running tests can be documented as a Skill. When the agent encounters a similar task, it can follow the workflow directly instead of planning it from scratch every time.
A Skill is typically organized as a directory, with a documentation file as its core component:
skills/└── build-and-test/├── SKILL.md└── scripts/└── run_tests.sh
An example SKILL.md file is shown below:
---name: build-and-testdescription: Install dependencies, build, and run tests in a specified project. Use when the user asks to validate code changes.---## Steps1. Check the current branch and working-tree status. If there are uncommitted changes, notify the user first.2. Install dependencies.3. Build the project. If the build fails, stop and output the error logs.4. Run the tests and summarize the passing and failing cases.## Boundaries- Do not run deployment commands.- Do not modify test configuration files.
When writing a Skill, pay attention to three points. Make the trigger conditions specific so that the Skill is not invoked for unrelated tasks. Define how failures should be handled at every step. Exclude dangerous operations from the Skill or require confirmation before executing them.
5. Built-In Tools and Security Boundaries
Built-in agent tools may include file operations, command execution, task management, web search, and multi-agent collaboration. These tools can be called automatically when needed, so their security boundaries must be defined in advance.
File tools: Grant access only to the project directory. Before making batch modifications, generate a change list for human review. Preserve version history before editing so changes can be rolled back.
Command execution tools: Run commands in a sandbox using an account with minimal privileges. Deletion, deployment, permission changes, and production operations must require human approval. Log all commands and their output for auditing.
Web search tools: Search results are external content. The agent should verify information against official documentation and should not execute commands copied directly from search results.
Multi-agent collaboration: Sub-agents should have fewer permissions than the primary agent, and each sub-agent should have a clearly defined scope of responsibility.
Tool Failure Troubleshooting Checklist
- Insufficient permissions: Check account permissions and sandbox policies. Do not immediately grant unrestricted access.
- Schema errors: Compare the request with the tool definition and verify parameter names, types, and required fields.
