Skip to main content
Glama
ActaLumen

@actalumen/mcp-server

Official
by ActaLumen

upload_document

Upload a PDF for compliance verification with automatic PII redaction before storage. Returns a document ID for subsequent retrieval.

Instructions

Upload a PDF to ActaLumen for compliance verification. The server applies organization-configured PII redaction before storage — the agent will only ever see redacted content in subsequent calls. Returns a document ID; the document is PROCESSING until embeddings finish (poll get_document for status=READY).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or ~/-relative path to a PDF. Must be inside ACTALUMEN_UPLOAD_DIR (default ~/actalumen-inbox) — the user controls which files agents can upload.
idNoOptional custom document ID (letters, digits, -, _, max 128). Useful for idempotent re-runs.

Implementation Reference

  • Defines the upload_document tool with its handler. The handler resolves the path, validates it's inside the allowed upload directory, checks it's a PDF file, reads it, and sends it as a multipart POST to /v1/documents.
    export const uploadDocument = defineTool({
      name: "upload_document",
      description:
        "Upload a PDF to ActaLumen for compliance verification. The server applies organization-configured PII redaction before storage — the agent will only ever see redacted content in subsequent calls. Returns a document ID; the document is PROCESSING until embeddings finish (poll get_document for status=READY).",
      inputSchema: Input,
      handler: async (input, { client, config }) => {
        const resolved = path.resolve(expandHome(input.path));
    
        const allowed = config.uploadDir;
        const rel = path.relative(allowed, resolved);
        if (rel.startsWith("..") || path.isAbsolute(rel)) {
          throw new Error(
            `Upload denied: ${resolved} is outside the allowed upload directory (${allowed}). ` +
              `Move the file there, or set ACTALUMEN_UPLOAD_DIR to a directory containing it.`,
          );
        }
    
        const stat = await fs.stat(resolved);
        if (!stat.isFile()) throw new Error(`Not a file: ${resolved}`);
        if (!resolved.toLowerCase().endsWith(".pdf")) {
          throw new Error("Only PDF files are supported.");
        }
    
        const bytes = await fs.readFile(resolved);
        const form = new FormData();
        form.append("file", new Blob([bytes], { type: "application/pdf" }), path.basename(resolved));
        if (input.id) form.append("id", input.id);
    
        return client.postMultipart("/v1/documents", form);
      },
    });
  • Zod schema defining the input for upload_document: 'path' (string, must be inside ACTALUMEN_UPLOAD_DIR) and optional 'id' (string, alphanumeric with - and _, max 128 chars, for idempotent re-runs).
    const Input = z.object({
      path: z
        .string()
        .describe(
          "Absolute or ~/-relative path to a PDF. Must be inside ACTALUMEN_UPLOAD_DIR (default ~/actalumen-inbox) — the user controls which files agents can upload.",
        ),
      id: z
        .string()
        .regex(/^[a-zA-Z0-9_-]{1,128}$/)
        .optional()
        .describe("Optional custom document ID (letters, digits, -, _, max 128). Useful for idempotent re-runs."),
    });
  • The uploadDocument tool is registered in the tools array exported from src/tools/index.ts, making it available as part of the tool set.
    export const tools: ToolDef[] = [
      uploadDocument,
      getDocument,
      listDocuments,
      listTemplates,
      startVerification,
      getVerification,
      chatWithDocument,
      getUsage,
    ];
  • Helper function expandHome that expands tilde (~) to the user's HOME directory, used for path resolution.
    function expandHome(p: string): string {
      if (p.startsWith("~/")) return path.join(process.env.HOME ?? "", p.slice(2));
      return p;
    }
Behavior5/5

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

With no annotations, the description fully covers behavioral traits: PII redaction applied server-side, document status set to PROCESSING, and polling via get_document needed. It discloses crucial server-side behavior without contradiction.

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 long, every phrase adds value, and it is front-loaded with the core purpose. 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?

Covers upload, redaction, processing state, and follow-up polling. Missing details like error handling or file size limits, but for a typical upload tool, the description is sufficiently complete given the schema and context signals.

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%, and the description adds value beyond schema by noting that 'path' must be inside ACTALUMEN_UPLOAD_DIR and 'id' is optional for idempotency. This enriches parameter understanding.

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 specifies 'Upload a PDF to ActaLumen for compliance verification,' clearly stating the action, resource, and purpose. It distinguishes this tool from siblings like get_document or list_documents, which retrieve or list instead of upload.

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 explains the upload use case and post-upload behavior (redaction, processing status, polling). It does not explicitly state when not to use the tool or compare to alternatives, but sibling tools have clearly different functions, making usage context clear.

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