Skip to main content
Glama
Matthew3957

ai-toolkit

by Matthew3957

drive_ensure_folder_path

Ensure a Google Drive folder path exists, creating missing folders as needed. Returns the leaf folder's ID, safe to retry.

Instructions

Create a folder path if it doesn't exist, and return the leaf's id.

Idempotent mkdir -p for Drive: calling it twice with the same path creates nothing the second time and returns the same id, so it is safe for an agent to retry. Only folders are created — this never creates a file.

path is slash-separated from your My Drive root, e.g. Career/consulting/clients/acme. Every segment that already exists is reused; a segment that matches two existing folders is an error rather than a guess, since continuing would build the rest of the path under an arbitrary one of them.

Returns the leaf folder's id and path, plus created, the list of segments that had to be made (empty when the path already existed).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It reveals idempotency (calling twice returns the same id), that only folders are created (never files), the error behavior when a segment matches two folders, and what the return value contains (leaf id, path, created list). This is a model of transparent behavior description, leaving no ambiguity about side effects or edge cases.

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 yet information-dense. Each paragraph earns its place: purpose, idempotency, path semantics, return values. The structure is logical and front-loaded with the core purpose, followed by crucial behavioral details. It avoids redundancy and is appropriately sized for the complexity of the tool.

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?

For a tool with one parameter but complex behavior (idempotency, path resolution, ambiguity handling), the description covers everything an agent needs to call it correctly: input format, expected outcomes, error conditions, and return payload. The presence of an output schema further reduces the need to explain return structure in prose. Nothing essential is missing.

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

Parameters5/5

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

The input schema provides zero description for the 'path' parameter (0% coverage). The description fully compensates by explaining the path format ('slash-separated from your My Drive root'), giving a concrete example ('Career/consulting/clients/acme'), and detailing how segments are handled (reuse, ambiguity error). This adds significant meaning beyond the raw schema, enabling correct usage.

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 opens with a precise statement of purpose: 'Create a folder path if it doesn't exist, and return the leaf's id.' This clearly names the verb (create), resource (folder path), and result (leaf id). It also introduces the 'idempotent mkdir -p' analogy, which instantly conveys the behavior. The scope ('only folders are created') further distinguishes it from file operations, making it easy to differentiate from siblings like drive_move_file or drive_update_file.

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

Usage Guidelines4/5

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

The description clearly implies when to use this tool: whenever an agent needs to ensure a folder path exists before proceeding. It explicitly mentions retry safety ('safe for an agent to retry'), which is a strong usage guideline. However, it does not explicitly name alternative tools or state when NOT to use it. The purpose is specific enough that an agent would not confuse it with other drive tools, but the lack of explicit exclusions keeps it from a perfect 5.

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