Skip to main content
Skills vs Tools: Understanding the Core Building Blocks of AI Agents

Skills vs Tools: Understanding the Core Building Blocks of AI Agents

Dec 21, 2025

If you been building AI agents lately, you probably heard terms like "tools" and "skills" thrown around alot. But what exactly is the difference? And more importantly, when should you use which one?

Let me break this down in a way that actually make sense.

The Quick Answer

Tools are executable code that an agent calls to perform specific operations - like fetching weather data, querying a database, or sending an email.

Skills are instructions and knowledge documents that teach an agent how to do something - like guidelines for code review, commit message conventions, or domain expertise.

Think of it this way: a tool is a power drill, while a skill is knowing how to build furniture.

The Key Difference

Here's the comparison that clarifies everything:

AspectToolsSkills
WhatExecutable codeInstructions/knowledge
FormatTypeScript/Python functionMarkdown document
PurposeAgent calls it to do somethingAgent reads it to learn how
SchemaInput/output with Zod/JSON SchemaYAML frontmatter + prose
ExecutionReturns structured dataAdded to conversation context

This distinction is crucial. Tools do things. Skills teach things.

Tools: The Executable Actions

Tools are functions with well-defined inputs and outputs that the agent can invoke when needed. They extend what an agent can actually accomplish.

Here's what a tool looks like in practice:

import { createTool } from "@mastra/core/tools";
import { z } from "zod";

export const weatherTool = createTool({
  id: "weather-tool",
  description: "Fetches weather for a location",
  inputSchema: z.object({
    location: z.string(),
  }),
  outputSchema: z.object({
    weather: z.string(),
  }),
  execute: async (inputData) => {
    const { location } = inputData;
    const response = await fetch(`https://wttr.in/${location}?format=3`);
    const weather = await response.text();
    return { weather };
  },
});

Key characteristics of tools:

  • Schema-defined - Clear input/output contracts
  • Deterministic - Same input should give same output (mostly)
  • Single responsibility - Does one thing and does it well
  • Returns data - The agent receives structured results

The agent decides when to use a tool based on the user's message, the agent's instructions, and the tool's description. The LLM reads the description and figures out if this tool helps solve the current problem.

Skills: The Knowledge Documents

Skills are fundamentally different. They're not code - they're documents that get injected into the agent's context to guide its behavior. Think of them as specialized instruction manuals.

A skill document might look like this:

---
name: code-review
description: Guidelines for reviewing code
trigger: When user asks for code review
---

# Code Review Skill

When reviewing code, follow these steps:

1. **Check for bugs** - Look for null pointer issues,
   off-by-one errors, race conditions
2. **Evaluate readability** - Is the code self-documenting?
   Are variable names clear?
3. **Assess performance** - Any obvious N+1 queries?
   Unnecessary loops?
4. **Security review** - Input validation, SQL injection, XSS

## Response Format

Structure your review as:
- Summary (1-2 sentences)
- Critical issues (must fix)
- Suggestions (nice to have)
- Positive observations

When this skill is activated, the entire document gets added to the conversation context. The agent doesn't execute it - it reads it and follows the guidance.

Why Skills Matter

Skills solve a common problem: you want the agent to behave consistently in certain situations without hardcoding everything into the system prompt.

Instead of cramming hundreds of lines of instructions into your agent's base prompt, you can:

  1. Keep the base prompt focused and general
  2. Load relevant skills dynamically based on context
  3. Update skills without touching agent code
  4. Share skills across multiple agents

When to Use What

This is where it gets practical. Here's a simple decision tree:

The Mental Model

Ask yourself one question:

"Does the agent need to do something or know something?"

DO something = Tool (executable code that returns data)

  • Fetch data from an API
  • Run a database query
  • Create or modify files
  • Send a message or notification

KNOW something = Skill (instructions that guide behavior)

  • How to review code properly
  • What format to use for commits
  • Domain-specific knowledge
  • How to structure responses

Combining Tools and Skills

The real power comes from using both together. Consider a PR review agent:

Skills it needs:

  • Code review guidelines
  • Your team's coding standards
  • Security checklist
  • How to format feedback

Tools it needs:

  • Fetch PR diff from GitHub
  • Read file contents
  • Post comments on PR
  • Check CI status

The skills tell the agent how to review code. The tools let it actually fetch the code and post comments.

export const prReviewAgent = new Agent({
  id: "pr-reviewer",
  instructions: `You review pull requests.
    Use your skills to guide the review process.
    Use tools to interact with GitHub.`,
  tools: {
    fetchPRDiff,
    readFile,
    postComment,
    checkCIStatus
  },
  // Skills loaded dynamically based on context
});

Common Mistakes to Avoid

1. Putting knowledge in tools

If your tool is just returning static text or guidelines, it should probably be a skill instead. Tools are for dynamic operations.

2. Making skills too generic

A skill called "be helpful" is useless. Skills should be specific: "how to handle refund requests" or "typescript coding standards for this project".

3. Overloading the base prompt

If your system prompt is 2000 words, you probably need to extract some of that into skills that load conditionally.

4. Ignoring tool descriptions

The description is literally how the agent decides to use your tool. "Fetches weather data for a given city name" is way better then "Gets weather".

5. Not validating schemas

Always use proper schemas for tools. They help the agent understand what data to provide and catch errors early.

Practical Example: Customer Support Agent

Let's put this together for a customer support scenario:

Skills (markdown documents):

# Refund Policy Skill
---
name: refund-policy
trigger: customer mentions refund, return, money back
---

Our refund policy:
- Full refund within 30 days, no questions
- 50% refund between 30-60 days
- No refunds after 60 days
- Always offer store credit as alternative

Response tone: Empathetic, solution-focused
# Escalation Skill
---
name: escalation
trigger: customer is angry, mentions lawyer, threatens
---

When to escalate to human:
- Legal threats
- Requests over $500
- Repeated complaints (3+)
- Customer explicitly requests human

How to escalate: Use the createTicket tool with priority: urgent

Tools (executable code):

const lookupOrderTool = createTool({
  id: "lookup-order",
  description: "Find order details by order ID or customer email",
  inputSchema: z.object({
    orderId: z.string().optional(),
    email: z.string().optional()
  }),
  execute: async (input) => {
    // Database query
    return { order: {...} };
  }
});

const processRefundTool = createTool({
  id: "process-refund",
  description: "Process a refund for an order",
  inputSchema: z.object({
    orderId: z.string(),
    amount: z.number(),
    reason: z.string()
  }),
  execute: async (input) => {
    // Payment API call
    return { success: true, refundId: "..." };
  }
});

The skills tell the agent when and how much to refund. The tools let it actually process the refund.

Wrapping Up

The distinction between skills and tools isnt about one being better then the other. Its about using the right abstraction:

  • Tools = executable actions that return data
  • Skills = contextual knowledge that guides behavior

Most production agents need both. Skills keep behavior consistent and maintainable. Tools extend what the agent can actually do in the world.

Start simple. Add tools when you need the agent to interact with external systems. Add skills when you find yourself writing the same guidance in multiple places or when you need consistent behavior for specific scenarios.

Your agents will be more capable and easier to maintain. Trust me on this one.

© 2026 Tawan. All rights reserved.