AI Agent Extension Guide: Tools, Services, and Skills Integration

    This article explains a four-layer approach to extending AI agents: making effective use of built-in tools, adding custom tools for specific gaps, connecting external services through standard protocols such as MCP, and packaging repeatable workflows as reusable skills. It covers tool definition essentials, governance practices, security considerations, and evaluation metrics, helping readers build agent capabilities that scale without increasing complexity or risk.

    Introduction: Why Agents Need “Hands and Feet”

    A formula that holds up repeatedly in agent engineering is: agent = LLM + prompt + tools. The LLM supplies reasoning and planning, the prompt constrains behavior and output format, and tools determine whether the agent can actually reach the outside world. Without a tool layer, the model can only produce suggestions; with tools, it can read files, run commands, write code, and query data, shifting from a chat target to an execution entity.

    It is worth stressing that more tools is not better. Tool sprawl creates three direct problems: first, selection difficulty, where the model wavers between semantically similar tools and call accuracy drops; second, context bloat, where tool descriptions consume large amounts of tokens and squeeze out actual task information; third, a wider permission surface, which raises the attack surface. The core of capability extension is therefore not stacking but layering and governance. This article follows four layers—built-in tools, custom tools, external service protocols, and skill packaging—to form a clear extension path.

    Layer 1: Make Good Use of the Built-In Toolbox

    Mainstream AI coding tools ship with a set of ready-to-use capabilities, typically covering four scenarios:

    • File operations: locating, reading, searching, and writing to support code understanding and modification;
    • Execution: running commands and invoking build and test workflows;
    • Task management: maintaining to-do lists and breaking long tasks into trackable steps;
    • Retrieval: web search and information gathering to compensate for the model’s limited knowledge freshness.

    These tools are selected automatically by the system on demand during reasoning, so users do not need to specify them manually and the learning cost is very low. The practical advice is: understand the capability boundaries first, then talk about extension. Many so-called “model capability gaps” are actually cases where existing tools are not used to their full potential—for example, failing to use the task list tool to maintain state during long tasks, which leads to inconsistency across multi-step operations.

    Layer 2: Custom Tools to Fill Gaps on Demand

    When built-in capabilities cannot cover a business scenario (such as querying internal data or calling private APIs), custom tools are needed. A reliable tool definition should contain four elements:

    1. name: semantically clear, avoid duplicating built-in tool names
    2. description: explains "what it does" and "when to use it"; this is the only basis for model selection
    3. input_schema: parameter types, required fields, and value constraints
    4. handler: the actual execution logic, returning a structured result

    There are three key writing points. First, descriptions are written for the model rather than for humans; state applicable and non-applicable scenarios clearly and avoid vague wording that causes incorrect calls. Second, keep parameters few and strongly constrained; replacing free text with enums can significantly reduce invalid calls. Third, return results should be structured and size-controlled; overly long content should be truncated with locating information, otherwise a single tool call can exhaust the context.

    Illustrative implementation (pseudocode):

    1. def query_metric(metric: str, window: str = "1h") -> dict:
    2. if metric not in ALLOWED_METRICS:
    3. return {"ok": False, "error": "unsupported metric"}
    4. data = store.fetch(metric, window)
    5. return {"ok": True, "rows": data[:200], "truncated": len(data) > 200}

    Engineering practice also requires three governance measures: least privilege (separate authorization for write and delete operations), timeouts and retries (to avoid long blocking that drags down the overall task), and full auditing (recording call parameters and result summaries for traceability). In addition, tool changes should support hot loading so that changes take effect immediately; otherwise the debugging loop is slowed by restart overhead.

    Layer 3: Connecting External Services Through Standard Protocols

    Tools are “local capabilities,” while enterprise internal systems often exist as services. In this case, a more suitable approach is to integrate through a standardized Model Context Protocol (MCP)-style solution: the server exposes a capability list, the client handles discovery, authentication, and invocation uniformly, and the agent does not need custom code for each system.

    The integration flow typically has four steps: declare the service address and transport method (local process or remote connection), complete identity authentication, pull the capability list, and invoke capabilities on demand during reasoning. The value of this approach lies in decoupling: upgrades on the service side do not affect agent-side code, and the same set of capabilities can be reused by multiple agents.

    On security, note the following: remote services should use least-privilege credentials, injected via environment variables or a key management service, and never written into configuration files or prompts; treat returned content under an “untrusted input” assumption to prevent external data from carrying instructions that cause prompt injection.

    Layer 4: Packaging Capabilities as Reusable Skills

    A skill is a higher level of abstraction: tools solve “a single call,” while skills solve “a whole workflow.” When a class of tasks requires a fixed sequence of steps, checklists, and output formats, it should be distilled into a skill—for example, a code review workflow, a defect localization workflow, or a pre-release check workflow.

    A well-formed skill package should include: a documentation file (describing the goal, trigger conditions, inputs and outputs), a workflow definition (steps and dependencies), declarations of required tools, and at least one verifiable example. The design principles are single responsibility, composability, and testability—skills connect through standard inputs and outputs rather than hard-coded dependencies on each other.

    Under presets such as “creation mode” that allow agents to self-iterate, skills can also be generated and optimized automatically—for example, letting an agent observe its own debugging process and reproduce a localization workflow. However, human confirmation gates and regression tests should be in place to avoid uncontrollable changes introduced by self-evolution.

    Practical Recommendations for Layered Extension

    Overall, the reasonable order for extending an agent is: first use built-in tools to their full potential, then add a small number of high-value custom tools, then connect enterprise systems via standard protocols, and finally distill stable workflows into skills. The evaluation dimensions should be fixed at four: call success rate, average token overhead, task completion time, and number of human interventions. If any dimension deteriorates, the priority should be to streamline the toolset rather than keep adding to it.

    In related practice at Baidu AI Cloud, these capabilities are typically used in combination: a container platform hosts the agent runtime, object storage holds skill packages and artifacts, a message queue decouples tasks, and logging services with monitoring and alerting observe the call chain. This combination is not unique to a specific product but is a fairly mainstream engineering paradigm in the industry; the key is to put observability and permission governance in place up front rather than remediate after the fact.