Files
docker-agent/docs/tools/script/index.md
T
Sayt-0 779659dd65 docs: point rel=canonical at the docs.docker.com mirrored pages
The Jekyll layout renders a canonical link when a page sets
canonical: front matter (added with the preview banner in #3413), but
no page carried a value yet. Set it on all 90 content pages mounted
on docs.docker.com so search engines treat the stable docs as
authoritative, completing phase 3.2 of #3371.

Every generated URL was verified to return 200 on docs.docker.com,
and the rendered site carries the tag on exactly those 90 pages
(homepage and 404 excluded). docs.docker.com itself ignores the
param: its head template always canonicalizes to the page permalink.
2026-07-03 14:46:30 +02:00

2.4 KiB

title, description, keywords, linkTitle, weight, canonical
title description keywords linkTitle weight canonical
Script Tool Define custom shell scripts as named tools with typed parameters. docker agent, ai agents, tools, toolsets, script tool Script 30 https://docs.docker.com/ai/docker-agent/tools/script/

Define custom shell scripts as named tools with typed parameters.

Overview

The script tool lets you define custom shell scripts as named tools. Unlike the generic shell tool where the agent writes the command, script tools execute predefined commands — ideal for exposing safe, well-scoped operations with descriptive names.

Configuration

Simple Scripts

toolsets:
  - type: script
    shell:
      run_tests:
        cmd: task test
        description: Run the project test suite
      lint:
        cmd: task lint
        description: Run the linter

Scripts with Parameters

Use ${param} interpolation and JSON Schema to define typed arguments:

toolsets:
  - type: script
    shell:
      deploy:
        cmd: ./scripts/deploy.sh ${env}
        description: Deploy to an environment
        args:
          env:
            type: string
            enum: [staging, production]
        required: [env]

Properties

Property Type Description
shell.<name>.cmd string Shell command to execute (supports ${arg} interpolation)
shell.<name>.description string Description shown to the model
shell.<name>.args object Parameter definitions (JSON Schema properties)
shell.<name>.required array Required parameter names
shell.<name>.env object Environment variables for this script
shell.<name>.working_dir string Working directory for script execution

Tip

Script vs. Shell

Use the shell tool when the agent needs to run arbitrary commands. Use the script tool when you want to expose specific, predefined operations with clear names and typed parameters — giving the agent less freedom but more safety.