Skip to main content
Glama

Analyze a File

analyze_file
Read-onlyIdempotent

Answer a question about one of the user's uploaded files.

Reads the file's contents and returns LuBot's answer: numbers computed from CSV / Excel tables, or text found in PDF, Word and image files, with the file named as the source. Use this when the user asks about one specific file; get the file_id from list_files first. Don't use it to compare several files at once.

Limits: requires sign-in; counts toward the user's LuBot plan like a My Files question; one file per call; answers can take up to a minute; questions are capped at 2000 characters.

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": {
      "file_id": "<file_id>",
      "question": "<question>"
    },
    "name": "analyze_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_idYesOne of the file_ids returned by list_files.
questionYesThe user's question about this file, in plain words.

Output Schema

NameRequiredDescriptionDefault
chartNo
citationsNo
narrativeYes
confidenceNo
data_statusNook

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / file_id / description
      Added value: +"One of the file_ids returned by list_files."
    • addedInput schema / properties / question / description
      Added value: +"The user's question about this file, in plain words."
    • changedOutput schema / $defs / FileMeta / description
      Previous value: -"Public-facing metadata for one file the caller owns.\n\n`file_id` is an opaque string — never a raw DB primary key path or\nfilesystem path — so a compromised token can't be used to probe\ninternal storage layout."New value: +"One file in the user's LuBot account."
    • changedOutput schema / description
      Previous value: -"Return type for `analyze_file`.\n\nMARKET-17 S5b-4: `narrative` is the web My Files engine's answer when\n`data_status == \"ok\"`, else a clear message. `citations` = the file the\nanswer is about. `chart` stays None (the engine's chart isn't safe to\nread from the shared agent). `confidence` is None unless real."New value: +"The answer to a question about one file, and which file it used."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "FileMeta": {
      +      "additionalProperties": false,
      +      "description": "Public-facing metadata for one file the caller owns.\n\n`file_id` is an opaque string — never a raw DB primary key path or\nfilesystem path — so a compromised token can't be used to probe\ninternal storage layout.",
      +      "properties": {
      +        "chunk_count": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Chunk Count"
      +        },
      +        "demo_mode": {
      +          "default": false,
      +          "title": "Demo Mode",
      +          "type": "boolean"
      +        },
      +        "file_id": {
      +          "minLength": 1,
      +          "title": "File Id",
      +          "type": "string"
      +        },
      +        "file_type": {
      +          "enum": [
      +            "csv",
      +            "xlsx",
      +            "pdf",
      +            "docx",
      +            "txt",
      +            "image",
      +            "other"
      +          ],
      +          "title": "File Type",
      +          "type": "string"
      +        },
      +        "filename": {
      +          "title": "Filename",
      +          "type": "string"
      +        },
      +        "row_count": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Row Count"
      +        },
      +        "uploaded_at": {
      +          "format": "date-time",
      +          "title": "Uploaded At",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "file_id",
      +        "filename",
      +        "file_type",
      +        "uploaded_at"
      +      ],
      +      "title": "FileMeta",
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": false,
      +  "description": "Return type for `analyze_file`.\n\nMARKET-17 S5b-4: `narrative` is the web My Files engine's answer when\n`data_status == \"ok\"`, else a clear message. `citations` = the file the\nanswer is about. `chart` stays None (the engine's chart isn't safe to\nread from the shared agent). `confidence` is None unless real.",
      +  "properties": {
      +    "chart": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": true,
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Chart"
      +    },
      +    "citations": {
      +      "items": {
      +        "$ref": "#/$defs/FileMeta"
      +      },
      +      "title": "Citations",
      +      "type": "array"
      +    },
      +    "confidence": {
      +      "anyOf": [
      +        {
      +          "maximum": 1,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ],
      +      "default": null,
      +      "title": "Confidence"
      +    },
      +    "data_status": {
      +      "default": "ok",
      +      "enum": [
      +        "ok",
      +        "limit",
      +        "timeout",
      +        "busy",
      +        "unavailable",
      +        "not_found",
      +        "invalid",
      +        "signed_out"
      +      ],
      +      "title": "Data Status",
      +      "type": "string"
      +    },
      +    "narrative": {
      +      "title": "Narrative",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "narrative"
      +  ],
      +  "title": "AnalysisResult",
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world, but the description adds substantial operational context the annotations cannot: requires sign-in, consumes the user's LuBot plan quota, one file per call, up to a minute latency, and a 2000-character question cap. These are exactly the constraints an agent needs before committing to a call.

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 purpose, then behavior, usage, and a compact 'Limits' block — well structured with no filler. Minor redundancy: describing what the answer contains (numbers vs. text, source attribution) overlaps with the existing output schema.

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?

Given an output schema is present, the description need not explain return values, and it doesn't over-explain. It covers auth, quota, latency, call cardinality, and the prerequisite lookup — everything needed to invoke it correctly.

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, but the description adds semantics the schema lacks: the 2000-character cap on the question and the one-file-per-call constraint on file_id scope. It does not add format hints for the question itself, which keeps it short of a 5.

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: 'Answer a question about one of the user's uploaded files', then enumerates what it actually does (computes numbers from CSV/Excel, extracts text from PDF/Word/images, cites the file as source). The 'one specific file' scope clearly separates it from analyze_portfolio and multi-file comparison.

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?

Explicit when-to-use ('when the user asks about one specific file'), an explicit when-not ('Don't use it to compare several files at once'), and a prerequisite routing step ('get the file_id from list_files first'). No inference required.

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