Skip to main content
Glama
ActaLumen

@actalumen/mcp-server

Official
by ActaLumen

chat_with_document

Ask grounded questions about documents and receive answers with citations; PII is redacted server-side to prevent leaks.

Instructions

Ask a grounded question about one or more documents. Returns an answer with citations into the document. PII in source documents has already been redacted server-side, so answers cannot leak redacted data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentIdsYesOne or more document IDs to ground the answer in. All must be READY.
messageYesThe user's question. Answers are grounded in retrieved chunks with page citations.
sessionIdNoOptional existing chat session ID to continue a multi-turn conversation.

Implementation Reference

  • The tool definition and handler for chat_with_document. The handler calls POST /v1/chat via the ActalumenClient.
    export const chatWithDocument = defineTool({
      name: "chat_with_document",
      description:
        "Ask a grounded question about one or more documents. Returns an answer with citations into the document. PII in source documents has already been redacted server-side, so answers cannot leak redacted data.",
      inputSchema: Input,
      handler: async (input, { client }) => client.post("/v1/chat", input),
    });
  • Input schema for chat_with_document: documentIds (array of strings, min 1), message (string), and optional sessionId (string).
    const Input = z.object({
      documentIds: z
        .array(z.string())
        .min(1)
        .describe("One or more document IDs to ground the answer in. All must be READY."),
      message: z.string().min(1).describe("The user's question. Answers are grounded in retrieved chunks with page citations."),
      sessionId: z
        .string()
        .optional()
        .describe("Optional existing chat session ID to continue a multi-turn conversation."),
    });
  • src/tools/index.ts:8-8 (registration)
    Import of the chatWithDocument tool from its module.
    import { chatWithDocument } from "./chat_with_document.js";
  • Registration of chatWithDocument in the tools array.
    chatWithDocument,
Behavior4/5

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

With no annotations provided, the description discloses key behaviors: answers are grounded with citations, PII redacted server-side. It does not cover error handling, rate limits, or token limits, but covers the main behavioral traits.

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 two sentences, front-loading purpose and output, then adding a behavioral note. Every sentence adds value with no wasted words.

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?

Given 3 parameters and no output schema, the description provides a clear purpose, return value (answer with citations), and a behavioral constraint (PII redacted). It could mention sessionId for multi-turn, but the schema handles that.

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?

Schema description coverage is 100%, so the schema already explains each parameter well. The description adds no extra meaning beyond the schema (e.g., documentIds must be READY is in schema). Baseline of 3 is appropriate.

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 clearly states the tool's purpose: asking a grounded question about documents and returning an answer with citations. It distinguishes from sibling tools like get_document (retrieves document info) and list_documents (lists documents) by focusing on question-answering.

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 implies usage context: use when you need a grounded answer from documents. It adds a safety guideline about PII redaction but does not explicitly contrast with siblings or state when not to use it.

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/ActaLumen/mcp-server'

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