Skip to content
Skills Library
AI & agents · Building & coding

tool-construction

/tool-construction

Dynamically building simple MCP servers or Python scripts to solve unique problems. Use when: tool construction.

Repository
gabbe ↗
Licence
CC-BY-4.0
Last repository change
24.10.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

CC-BY-4.0, otwarta.

What it does and when to use it

Dynamically building simple MCP servers or Python scripts to solve unique problems. Use when: tool construction.

Original author description

Dynamically building simple MCP servers or Python scripts to solve unique problems. Use when: tool construction.

How it works

  1. Goal
  2. Steps
  3. 1. Script vs MCP
  4. 2. Building an MCP Server (Quick-Start)
  5. 3. Tool Safety
  6. 4. The "Toolsmith" Loop
  7. Security & Guardrails
Original SKILL.md headings · 40 lines, 566 words
SKILL.md preview
---
name: tool-construction
description: "Dynamically building simple MCP servers or Python scripts to solve unique problems. Use when: tool construction."
license: CC-BY-SA-4.0
metadata:
  source: "agents/skills/coding/tool-construction.skill.md"
  tags: "coding"
  core: "false"
  context_cost: "low"
---
# tool-construction Skill

## Goal
This skill guides the creation of NEW capabilities for the swarm.

## Steps
## 1. Script vs MCP
- **Script**: One-off task (e.g., "Migrate CSV to JSON").
- **MCP Server**: Persistent tool needed by LLM (e.g., "Query internal Knowledge Base").

## 2. Building an MCP Server (Quick-Start)
Use the `@modelcontextprotocol/sdk`:
1.  Define Tools (Input Schema).
2.  Implement Logic.
3.  Connect to Stdio/SSE.

## 3. Tool Safety
- **Sandboxing**: Generated tools should not have root access.
- **Review**: A generated tool must be reviewed by `ops-security` (or human) before execution if it modifies files.

## 4. The "Toolsmith" Loop
1.  **Identify Pain**: "We keep grepping for X manually."
2.  **Spec Tool**: "Build a tool that finds X and formats as JSON."
3.  **Implement**: Write `tools/find_x.py`.
4.  **Register**: Add to `project_tools` in context configuration.

## Security & Guardrails

### 1. Skill Security (Tool Construction)
- **Zero-Day Propagation**: By building new MCP servers or scripts (Step 2), the agent is effectively compiling new executable capabilities into the swarm's runtime. If the LLM generates a tool that uses `shell=True` in Python or unsanitized `exec()` calls in Javascript to process inputs, it creates an immediate Remote Code Execution (RCE) backdoor. The agent must rigidly enforce static analysis and strictly prohibit the use of arbitrary eval functions within newly minted tools.
- **The Persistence Vector**: Step 1 differentiates Scripts from MCP Servers. An attacker could trick the agent into classifying a malicious script as a "Persistent MCP Server," embedding the malware permanently into the agent's startup context. All newly constructed MCP servers MUST undergo a mandatory quarantine and explicit `ops-security` human approval (Step 3) before they are permitted to register in the global `project_tools` context.

### 2. System Integration Security
- **Sandbox Escape via Tool Permissions**: Step 3 explicitly mandates Sandboxing. If the generated script requires reading a specific log file, the LLM might lazily request full host volume mounts or wildcard file read permissions for the tool's container. The framework must enforce the Principle of Least Privilege, binding the new tool's capabilities strictly to the minimum required system scopes necessary to achieve its defined `spec`.
- **Credential Harvesting in Custom Scripts**: When building a tool to interact with an external API (e.g., "Build a tool to query JIRA"), the LLM might attempt to prompt the user for their personal access token, or worse, attempt to hardcode a token it finds in its context window. All constructed tools MUST rely on secure, centralized credential injection mechanisms (like temporary STS tokens or encrypted Vault mounts) and must never request or store raw secrets directly.

### 3. LLM & Agent Guardrails
- **Scope Creep (The Swiss Army Knife Anti-Pattern)**: During the "Toolsmith Loop" (Step 4), the LLM might expand the definition of "find X" to also "delete X, restart the service, and email the logs." Complex, multi-responsibility tools drastically increase the risk of unintended consequences. The agent must enforce strict, single-responsibility boundaries for all generated tools, forcing the LLM to decompose complex actions into a pipeline of simple, auditable units.
- **Hallucinated SDK Interfaces**: When building the MCP Server (Step 2), the LLM might hallucinate functions or configuration patterns that do not exist in the official `@modelcontextprotocol/sdk`. This will result in silent registration failures or broken IPC connections. The agent must validate the newly constructed tool's syntax against the formal OpenAPI/JSON-schema specification of the MCP protocol prior to deployment.

Versions

The database has no other skills named tool-construction.

Database snapshot: 13.11.2026 · package version 49c370686b78 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100mcp-tool-scout
    Discovers MCP servers and reads tool schemas before calling MCP tools. Use for: mcp tools, MCP schema, discover MCP, which MCP tool.
  • 100mcp-builder
    Build, register, and use custom MCP servers within this environment. Use this when asked to create a new tool, capability, or integration as an MCP server.
  • 100creating-mcp-servers
    Creates production-ready MCP servers using FastMCP v2. Use when building MCP servers, optimizing tool descriptions for context efficiency, implementing progressive disclosure for multiple capabilities, or packaging servers for distribution.
  • 100mcp-tool-discovery
    How to discover and use MCP tools when you're unsure which one is configured. Triggers when an agent doesn't know whether an MCP tool exists for a task, or when a task description maps to multiple possible MCP servers.
  • 100managing-mcp-servers
    Use when the user asks to add, change, remove, enable or disable an MCP server, or when an MCP tool is missing, needs sign-in, fails, or was blocked. ThinkRail runs pi in-process, so there is no `pi` command to call.
  • 100argument-construction-from-artifacts
    Build tool arguments from captured artifacts rather than from memory, so ids and paths are exact. Use when a tool needs an identifier that already exists in a capture, report or file

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.