Skip to main content
Glama

mktemp

Destructive

Create temporary files or directories with unique, unpredictable names atomically. Prevents race conditions during temporary workspace creation. Supports prefix and suffix for naming control.

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
directoryNoCreate a temporary directory.
dry_runNoReport a candidate path without creating it.
prefixNoTemporary path prefix.tmp.
suffixNoTemporary path suffix.
tmpdirNoDirectory where the temporary path should be created. Defaults to cwd.
Behavior5/5

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

The description discloses destructive behavior (creating files/dirs) consistent with the annotation 'destructiveHint: true', and adds context about atomic creation, return format (JSON with path), and naming control.

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?

The description is concise with four sentences, each providing essential information: core purpose, behavioral warning, return format, naming support, and usage guidance.

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?

The description covers all necessary context: purpose, behavior, parameters, return format, and usage guidance. Given no output schema, explaining the return is sufficient. All 5 parameters are documented in the schema.

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 baseline is 3. The description adds value by mentioning prefix and suffix for naming control, which reinforces the parameter purposes beyond 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?

The description clearly states it creates temporary files/directories with unique, unpredictable names atomically to prevent race conditions. It differentiates itself from the sibling 'mkdir' tool by specifying it is not for persistent directories.

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?

The description explicitly states when to use ('safe temporary workspace creation in agent workflows') and when not to use ('Not for persistent directories'), and provides an alternative ('use '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