Skip to main content
Glama

files.create

Create up to 200 markdown, mermaid, or HTML files in a knowledge base or project, with automatic indexing and isolated per-item error reporting. Choose destination and kind for correct routing.

Instructions

Create one or more markdown, mermaid, or HTML files in the knowledge base or project (up to 200 per call). Pass a single-element files array for the one-file case. This operation writes each file to disk and adds it to the local SQLite FTS5 index. Destination can be 'knowledge' (global KB), 'project' (reference file inside a project repo), or 'kontexta' (internal Kontexta schema file). If destination is 'project' or 'kontexta', project_id is strictly required. If destination is 'knowledge', 'kind' is strictly required for md files — pick 'dictionary' (authoritative source-of-truth) or 'note' (informational snapshot); see the kind param for the rubric. No external auth required. Rate limits do not apply (local operation). Per-item failures are isolated to errors[] — the rest of the batch still commits; a single-item call still reports its failure the same way. Returns {created_count, error_count, created, errors}. If a destination directory does not exist, it will be created automatically. To modify an existing file, use 'files.update' instead. Pass format='mmd' on an item to create a Mermaid diagram file (.mmd) — for destination='knowledge' it's auto-routed to the KB's mermaid/ bucket (kind ignored, not required); for destination='project' it's written wherever folder says, same as any project file. Pass format='html' for an HTML report — destination MUST be 'knowledge' (html reports are auto-routed to the KB's html/ bucket; kind is ignored and not required for html). Format defaults to 'md'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filesYesFiles to create. Single-element array = one-file case. Max 200 per call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changedv5.0.0
    • removedInput schema / properties / content
      Removed value: -{
      -  "description": "Content of the file",
      -  "type": "string"
      -}
    • removedInput schema / properties / destination
      Removed value: -{
      -  "description": "Destination type",
      -  "enum": [
      -    "knowledge",
      -    "project",
      -    "kontexta"
      -  ],
      -  "type": "string"
      -}
    • addedInput schema / properties / files
      Added value: +{
      +  "description": "Files to create. Single-element array = one-file case. Max 200 per call.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "content": {
      +        "description": "Content of the file",
      +        "type": "string"
      +      },
      +      "destination": {
      +        "description": "Destination type",
      +        "enum": [
      +          "knowledge",
      +          "project",
      +          "kontexta"
      +        ],
      +        "type": "string"
      +      },
      +      "folder": {
      +        "description": "Optional folder path",
      +        "type": "string"
      +      },
      +      "format": {
      +        "description": "File extension to write. Defaults to 'md'. Use 'html' for HTML reports.",
      +        "enum": [
      +          "md",
      +          "mmd",
      +          "html"
      +        ],
      +        "type": "string"
      +      },
      +      "kind": {
      +        "description": "REQUIRED for destination='knowledge'. 'dictionary' = source of truth (mappings, glossaries, runbooks, PR templates). 'note' = snapshot (meeting notes, sprint reviews, PR findings, post-mortems). Test: if this file disagreed with the code, who wins? File wins → dictionary; file loses → note. Ignored for destination='project' or 'kontexta'.",
      +        "enum": [
      +          "dictionary",
      +          "note"
      +        ],
      +        "type": "string"
      +      },
      +      "project_id": {
      +        "description": "Project ID (required for project/kontexta destinations)",
      +        "type": "number"
      +      },
      +      "tags": {
      +        "description": "Optional array of tags",
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "title": {
      +        "description": "Title of the file",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "title",
      +      "content",
      +      "destination"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 200,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • removedInput schema / properties / folder
      Removed value: -{
      -  "description": "Optional folder path",
      -  "type": "string"
      -}
    • removedInput schema / properties / format
      Removed value: -{
      -  "description": "File extension to write. Defaults to 'md'. Use 'html' for HTML reports.",
      -  "enum": [
      -    "md",
      -    "mmd",
      -    "html"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / kind
      Removed value: -{
      -  "description": "REQUIRED for destination='knowledge'. 'dictionary' = source of truth (mappings, glossaries, runbooks, PR templates). 'note' = snapshot (meeting notes, sprint reviews, PR findings, post-mortems). Test: if this file disagreed with the code, who wins? File wins → dictionary; file loses → note. Ignored for destination='project' or 'kontexta'.",
      -  "enum": [
      -    "dictionary",
      -    "note"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / project_id
      Removed value: -{
      -  "description": "Project ID (required for project/kontexta destinations)",
      -  "type": "number"
      -}
    • removedInput schema / properties / tags
      Removed value: -{
      -  "description": "Optional array of tags",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / title
      Removed value: -{
      -  "description": "Title of the file",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "title",
      -  "content",
      -  "destination"
      -]New value: +[
      +  "files"
      +]
  2. Addedv4.7.2

TDQS

A4.9/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 behavioral burden, and it does so thoroughly. It discloses side effects (writes to disk, adds to SQLite FTS5 index), auth and rate-limit context (none apply), error isolation semantics (per-item failures in errors[]), return shape ({created_count, error_count, created, errors}), and automatic directory creation. This is far beyond what the schema alone conveys.

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?

The description is long, but the tool has many routing rules and conditional requirements that justify the length. It is front-loaded with the core purpose and max batch limit, then progressively covers destinations, error isolation, return values, and format specifics. A small amount of redundancy with the schema (e.g., single-element array note, kind rubric) keeps it from a perfect 5.

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 no output schema and no annotations, the description is remarkably complete: it specifies acceptable destinations, required and optional parameters, format-specific routing, batch size limits, error behavior, return shape, auth/rate-limit status, and the sibling to use for modifications. An agent has enough information to invoke the tool correctly in all supported scenarios.

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?

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: the single-element array convention, the kind rubric for dictionary vs note, destination-specific project_id requirements, auto-routing for mmd and html formats, and the fact that format defaults to 'md'. These are operationally critical details that would otherwise be easy to miss or misinterpret.

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 specific verb and resource: 'Create one or more markdown, mermaid, or HTML files in the knowledge base or project.' It immediately differentiates from siblings like files.update and files.delete by defining this as the creation operation, and it scopes the max batch size (200) and supported formats.

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?

Usage guidance is explicit: 'To modify an existing file, use files.update instead.' It also gives clear conditional routing rules for each destination ('project' or 'kontexta' require project_id; 'knowledge' requires kind for md files), and explains when format='mmd' or 'html' should be chosen. An agent can decide to use this tool versus alternatives without ambiguity.

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