Agent Extension Mechanisms in Practice: Tools, Services, and Skills
This article explains how to extend an AI agent beyond its base model through three main paths: built-in tools, custom tools, and external services connected via standard protocols. It covers tool design essentials such as names, descriptions, parameter schemas, and handlers, plus how to package reusable workflows as skills. It also outlines governance and verification practices, including least-privilege access, observability, retry limits, and regression test suites, to keep agent capabilities controllable as they scale.
1. Why Agents Need “Hands and Feet”: Rethinking Capability Boundaries
A common misconception in development is equating an agent’s capabilities with those of its underlying model. A more accurate view is: agent = large model + prompt + tools. The model handles reasoning, planning, and language; the prompt constrains behavior and output format; tools interact with the real world. A model without a tool layer is like a person with a brain but no limbs—it can analyze requirements and propose solutions, but it cannot read files, run commands, query databases, or call remote APIs.
So the focus of agent engineering is usually not “switch to a stronger model,” but how to design an extensible, governable, and observable tool and skill system. This article discusses three mainstream extension paths: using built-in tools, building custom tools, and connecting external services through standard protocols. It then introduces the idea of packaging skills.
2. Layer One: Making Good Use of the Built-in Toolbox
Mature agent runtime frameworks usually ship with a set of ready-to-use capabilities covering:
- File: search, read, write, edit, and directory traversal;
- Execution: run commands, execute scripts, and invoke package managers in a controlled environment;
- Retrieval: web search, fetching, and content summarization;
- Task: task list maintenance, progress tracking, and plan decomposition;
- Collaboration: subtask dispatch and multi-agent coordination;
- Extension: load user-defined skills or external services.
In practice, developers should do three things first:
- Build a tool inventory and purpose mapping that makes clear “which tool to use for which task,” avoiding repeated trial and error among similar tools;
- State tool usage priority in the prompt, for example, “use the retrieval tool to confirm facts first, then use the write tool to persist results”;
- Add confirmation steps for high-risk tools, such as requiring explicit confirmation when overwriting files, deleting data, or executing external commands.
3. Layer Two: Custom Tools, Extended on Demand
When built-in capabilities do not cover a business scenario, custom tools are the most direct extension. A well-formed tool usually has four elements: name, description, parameter schema, and handler. The description and parameter schema determine whether the model can call it correctly, and are often more critical than the implementation itself.
A sample definition (pseudocode):
tool(name="query_order_status",description="Query the current status and latest logistics node of an order by order ID",parameters={"order_id": "string, order ID, 12 characters","with_history": "boolean, whether to return historical nodes, default false"},handler=lambda order_id, with_history=False: service.query(order_id, with_history))
Design points include:
- Write the description to cover “what it does, when to use it, and when not to,” reducing misuse;
- Keep parameters flat and clearly typed, avoiding deeply nested structures;
- Return structured results with controlled size; for oversized content, return a summary plus locator information;
- Keep tool granularity moderate: too coarse makes parameters complex, too fine makes call chains long;
- Tag each tool with a permission level and timeout for unified governance.
For debugging, go “offline first, then online”: unit-test the handler with fixed inputs to confirm a stable return structure; then connect the model and observe selection accuracy and parameter-filling correctness across multi-turn tasks.
4. Layer Three: Connecting External Services via Standard Protocols
Beyond local tools, agents often need to access databases, internal systems, or third-party capabilities. The common industry approach is “external service + standardized protocol adapter”: the adapter layer describes external interfaces uniformly as a set of tools, and the agent calls only through the unified protocol without needing to know backend differences.
Implementation advice:
- Handle authentication, rate limiting, retries, and timeouts centrally in the adapter layer to avoid polluting business code;
- Trim and redact fields in external responses, exposing only the minimum information needed to complete the task;
- Tag each external capability as read or write, with write operations requiring confirmation by default;
- Log call traces (tool name, parameter summary, latency, status code) for troubleshooting and auditing.
5. Skill Packaging: Turning Processes into Reusable Assets
Tools solve “single actions”; skills solve “combined workflows.” A skill usually exists as a structured document with optional scripts, fixing the steps, constraints, and acceptance criteria for a class of tasks, loaded by the agent on demand. Compared with repeatedly stacking process instructions in prompts, skills are easier to version, review, and share.
A usable skill document skeleton:
name: api-mock-and-verifydescription: Generate a local mock service for a given API and verify its response structuresteps:- Parse the API definition and list fields and required items- Generate mock data and a local service- Send requests and compare field completeness and types- Output a difference reportconstraints:- Do not modify production configuration- Listen only on the local loopback addressacceptance:- Number of missing required fields is 0- Number of type mismatches is 0
6. Governance and Verification: Keeping Extensions Controllable
The stronger the extension capability, the higher the governance cost. Build constraints in four areas: first, least privilege, granting tools and directory scope per task; second, full-chain observability, logging calls and latency uniformly; third, recoverable failures, using backoff retries with upper limits for timeouts and rate limits; fourth, verifiable regression, maintaining a fixed test case set for tools and skills and running it automatically after each change.
In related practice at Baidu AI Cloud, such capabilities are typically used with general cloud products like container platforms, logging services, monitoring and alerting, and object storage: compute and runtime environments host the agent and tool processes, logging and monitoring provide observability, and object storage holds skill and test case assets, forming a closed loop from development and debugging to launch and operations.
7. Conclusion
An agent’s ceiling is largely determined by the design quality of its extension system. Build progressively in this order: make good use of built-in tools first, then develop custom tools, then connect external services, and finally package skills, while filling in permissions, logging, and regression verification along the way. This delivers usable capabilities quickly and keeps them controllable and maintainable as they scale.
