Skip to main content
Glama

Create directory

create
Idempotent

Makes a workspace directory and any missing parent folders by default; use it when you need an empty directory before adding files.

Instructions

Create a directory; missing parents are created unless create_dirs=false. Use when: you need an empty directory. For a file use write_file, which also creates parent folders. Avoid when: you edit existing content (edit_file). Output: directory_created {relative_path, created, parents_created}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "relative_path": "<relative_path>"
    },
    "name": "create"
  }
}

Input Schema

NameRequiredDescriptionDefault
reasonNoOptional why (max 400 chars), audit-logged.
create_dirsNotrue (default) creates missing parent directories; false fails when a parent is missing.
relative_pathYesWorkspace-relative ('.' = root); absolute/.. outside it rejected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv4.5.0
    • removedInput schema / properties / create_dirs / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "maximum": 1,
      -    "minimum": 0,
      -    "type": "integer"
      -  }
      -]
    • changedInput schema / properties / create_dirs / description
      Previous value: -"1 creates missing parent directories (default 1); 0 fails when a parent is missing."New value: +"true (default) creates missing parent directories; false fails when a parent is missing."
    • removedInput schema / properties / create_dirs / maximum
      Removed value: -1
    • removedInput schema / properties / create_dirs / minimum
      Removed value: -0
    • changedInput schema / properties / create_dirs / type
      Previous value: -"integer"New value: +"boolean"
  2. Addedv4.0.0

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations cover safety (readOnlyHint=false, destructiveHint=false, idempotentHint=true), and the description adds real value on top: parent-directory creation semantics and the exact return shape. It stops short of stating explicitly what happens when the directory already exists (only implied by idempotentHint), which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded purpose sentence followed by compact 'Use when' / 'Avoid when' / 'Output' labels. Every sentence carries actionable information; no filler or repetition of the tool title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Only 3 parameters, one required, with full schema coverage; the description still supplements with parent-creation behavior and an output shape note. For a low-complexity creation tool, an agent has everything needed to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds behavioral meaning beyond the schema by explaining the create_dirs consequence ('missing parents are created unless create_dirs=false') and the returned parents_created field. The relative_path and reason parameters are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Create a directory') plus the key default behavior (missing parents created). It explicitly distinguishes itself from write_file (files) and edit_file (editing existing content), so an agent can tell it apart from siblings without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit 'Use when' and 'Avoid when' clauses and names the correct alternatives for each case (write_file for files, edit_file for edits). Nothing about tool selection is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.