Skip to main content
Glama

Create file

create_file

Creates a new small plain-text file (.md, .txt, .html, or .json) in the knowledge base. Fails if a file already exists at that path - use update_file to change one that does. Parent folders are created automatically. Use create_upload instead for anything else: pdf / doc / ppt, images, .csv, .xls / .xlsx, or a large file of any kind (including a large .md/.txt/.html/.json) - this tool rejects content it can't store inline rather than silently corrupting it. Writing into a workspace other than your default needs confirmation - see confirm_token. To create an IMAGE (.png, .jpg, .jpeg, .gif, .webp, up to 256 KB) pass content_base64 instead of content: the image is stored and complete when this returns.

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": {
      "path": "<path>",
      "context": "<context>"
    },
    "name": "create_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFull path including the filename, e.g. '/reports/q3.md'. Must start with '/'.
tagsNoOptional freeform tags.
typeNoThe file's category - a lowercase slug you choose ([a-z0-9-]), NOT a mime type or extension. Groups files for the `type` filter when listing. Use 'doc' unless you have a reason to pick another. Never use 'entity', 'relation', 'fact', or 'community' - the knowledge graph reserves those. Ignored when content_base64 is used - an image category comes from its bytes.
titleNoHuman-readable title, shown in listings and weighted in search. Defaults to the filename without its extension.
contentNoThe file's full text content.
contextYesExplain why you are calling this tool and how it fits into the user's overall goal. This parameter is used for analytics and user intent tracking. YOU MUST provide 15-25 words (count carefully). NEVER use first person ('I', 'we', 'you') - maintain third-person perspective. NEVER include sensitive information such as credentials, passwords, or personal data. Example (20 words): "Searching across the organization's repositories to find all open issues related to performance complaints and latency issues for team prioritization."
descriptionNoOne-line summary of the contents. Weighted in search, so worth setting.
workspace_idNoWhich workspace to act in - a workspace id (whoami returns the id of your default workspace). Omit to use your default workspace.
confirm_tokenNoOnly when writing into a workspace other than your default: the first call returns a `confirmation_required` result carrying a `confirm_token`; call again with the same arguments plus that token to proceed.
content_base64NoThe bytes of an IMAGE file (.png, .jpg, .jpeg, .gif or .webp - not .svg), base64-encoded: standard alphabet, padded, at most 256 KB decoded. Use this instead of `content`, never together with it. The path extension must match the image format. Finishes before the call returns - no create_upload or polling. Larger images, or any other binary format, still need create_upload.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the generic non-read-only, non-destructive, non-idempotent profile. The description adds real behavior: it fails on existing paths, auto-creates parent folders, rejects oversized content rather than truncating it, and requires a confirm_token round-trip for other workspaces. The synchronous image-write guarantee is also disclosed.

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

Conciseness4/5

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

Front-loaded with the core action and the exclusion rules, and every sentence carries information. It is a dense single block, though, and the image guidance at the end could be split for easier scanning.

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 10-parameter mutation tool with no output schema, the description covers the failure mode, side effects, the confirmation flow, and the binary-content branch. An agent has enough to call it correctly on the first attempt.

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 cross-parameter meaning the schema does not: content_base64 is an alternative to content (never together), and the image path extension must match the format. It does not restate the context or type constraints, which the schema already handles well.

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 ('Creates a new small plain-text file') and immediately bounds the scope to .md/.txt/.html/.json. It explicitly distinguishes itself from update_file and create_upload, so an agent can route correctly without opening any schema.

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?

Gives explicit when-to-use and when-not-to-use rules: use update_file if the path exists, use create_upload for pdf/doc/ppt, images, csv, xls, or any large file. It also names the confirmation path for non-default workspaces, leaving nothing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources