SKILLS & TOOLS

Skills & Tools

Extend agent capabilities with skills and tools.

Skills

Skills are modular capabilities that enhance how agents process information. They are integrated into the agent’s reasoning pipeline.

Built-in Skills

Zod includes several built-in skills:

SkillDescriptionImport
conversationNatural language dialoguezod-framework/skills
reasoningLogical thinkingzod-framework/skills
codingCode generation & analysiszod-framework/skills
visionImage understandingzod-framework/skills
memoryContext retentionzod-framework/skills
mathMathematical computationzod-framework/skills
translationLanguage translationzod-framework/skills
summarizationText summarizationzod-framework/skills

Using Skills

import { conversation, reasoning, coding } from 'zod-framework/skills';

const developer = new Agent({
  name: 'Developer',
  model: 'gpt-4',
  skills: [conversation, reasoning, coding],
});

Creating Custom Skills

You can create custom skills by extending the Skill class:

import { Skill } from 'zod-framework';

class SentimentAnalysis extends Skill {
  name = 'sentiment-analysis';
  description = 'Analyze the sentiment of text';

  async process(input, context) {
    const sentiment = await this.analyze(input);
    return {
      ...input,
      metadata: {
        ...input.metadata,
        sentiment: sentiment.score,
      },
    };
  }

  async analyze(text) {
    // Implement sentiment analysis logic
    return { score: 0.8, label: 'positive' };
  }
}

export const sentimentAnalysis = new SentimentAnalysis();

Tools

Tools allow agents to interact with external systems and perform actions in the real world.

Built-in Tools

ToolDescriptionImport
filesystemRead/write fileszod-framework/tools
web-searchSearch the internetzod-framework/tools
databaseQuery databaseszod-framework/tools
terminalExecute shell commandszod-framework/tools
httpMake HTTP requestszod-framework/tools
emailSend emailszod-framework/tools
gitGit operationszod-framework/tools

Using Tools

import { filesystem, webSearch, terminal } from 'zod-framework/tools';

const assistant = new Agent({
  name: 'Assistant',
  model: 'gpt-4',
  skills: ['conversation', 'reasoning'],
  tools: [filesystem, webSearch, terminal],
});

Creating Custom Tools

Create custom tools by extending the Tool class:

import { Tool } from 'zod-framework';

class WeatherTool extends Tool {
  name = 'weather';
  description = 'Get current weather information for a location';
  
  parameters = {
    location: {
      type: 'string',
      description: 'The city and country',
      required: true,
    },
  };

  async execute({ location }) {
    const response = await fetch(
      `https://api.weather.com/v1/current?location=${location}&key=${API_KEY}`
    );
    const data = await response.json();
    
    return {
      temperature: data.temperature,
      conditions: data.conditions,
      humidity: data.humidity,
    };
  }
}

export const weather = new WeatherTool();

Tool Security

Control tool access and permissions:

import { Tool, Permissions } from 'zod-framework';

class DatabaseTool extends Tool {
  name = 'database';
  
  async checkPermissions(context) {
    if (!context.user.isAdmin) {
      throw new Error('Admin permissions required');
    }
    return true;
  }

  async execute(query) {
    // Only executes if checkPermissions passes
    return this.db.query(query);
  }
}

Tool Calling

Agents can automatically choose and call tools:

const result = await agent.task(
  'Search for recent articles about AI and save them to a file',
  {
    tools: [webSearch, filesystem],
    autoCall: true, // Allow automatic tool calling
  }
);

Best Practices

  1. Choose skills deliberately: Only enable skills the agent actually needs
  2. Limit tool access: Follow the principle of least privilege
  3. Handle tool failures: Implement error handling for tool execution
  4. Validate inputs: Validate tool parameters before execution
  5. Log tool usage: Monitor how agents use tools for debugging

Continue to Harness to learn about the orchestration layer.

Copyright © 2026 Zod · GitHub