Skip to main content
Glama

mktemp

Destructive

Create temporary files or directories with unique names to prevent race conditions. Ideal for safe temporary workspace creation in agent workflows.

Instructions

Create temporary files or directories with unique, unpredictable names atomically to prevent race conditions. Destructive: creates files/dirs on the filesystem. Returns JSON with the created path. Supports prefix and suffix for naming control. Use for safe temporary workspace creation in agent workflows. Not for persistent directories — use 'mkdir'. See also 'mkdir'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixNoTemporary path prefix.tmp.
suffixNoTemporary path suffix.
tmpdirNoDirectory where the temporary path should be created. Defaults to cwd.
dry_runNoReport a candidate path without creating it.
directoryNoCreate a temporary directory.
Behavior4/5

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

Annotations already indicate destructiveHint=true; the description adds context on atomicity, race condition prevention, and returning JSON path. Does not cover failure behavior or cleanup.

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?

Concise, front-loaded with the main purpose, and each sentence adds value. No unnecessary words.

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

Completeness4/5

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

Given no output schema, the description mentions return format ('Returns JSON with the created path'). Covers parameter hints and alternatives. Missing error info or permissions, but overall sufficient.

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

Parameters3/5

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

Schema coverage is 100% with all parameters described. The description mentions prefix/suffix but adds no new meaning beyond the schema. Baseline 3 applies.

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?

The description clearly specifies the tool creates temporary files/directories with unique, unpredictable names atomically to prevent race conditions, distinguishing it from 'mkdir'.

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?

Explicitly states when to use ('safe temporary workspace creation') and when not to ('Not for persistent directories'), and provides an alternative ('mkdir').

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/caseSHY/AI-CLI'

If you have feedback or need assistance with the MCP directory API, please join our Discord server