Skip to main content
Glama

push_directory

Save the current directory onto a stack and switch to a new directory, enabling quick return to previous locations.

Instructions

Pushes the current directory onto a stack and changes to a new directory.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryPathYesPath to the directory to set as active. Supports absolute paths, paths relative to the current active directory, and ~ for home directory.
Behavior4/5

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

No annotations are provided, so the description carries the full burden. It clearly discloses the two side effects: pushing the current directory onto a stack and changing to a new directory. It does not mention error behavior or stack lifetime, but the core behavioral traits are transparent.

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 a single concise sentence that effectively conveys both the push action and the directory change. It avoids redundancy and gets straight to the point.

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?

The tool is simple, with one fully documented parameter and no output schema. The description covers the core operation adequately. It could mention the paired pop_directory or failure conditions, but those are minor gaps given the tool's low complexity.

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?

The schema provides a complete description of directoryPath (absolute, relative, ~), so coverage is 100%. The tool description adds no additional parameter detail beyond 'new directory', so it does not exceed the schema baseline.

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 uses specific verbs 'pushes' and 'changes to' to clearly state the stack push operation and the resulting directory change. This distinguishes it from siblings like change_directory (which simply changes) and pop_directory (which pops), making the purpose unambiguous.

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

Usage Guidelines3/5

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

The stack semantics imply a usage pattern of saving the current directory before changing, but the description does not explicitly say 'use this when you need to return later' or compare with alternatives like change_directory. No exclusions or alternative tools are mentioned.

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/r-huijts/xcode-mcp-server'

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