Skip to main content
Glama
huiseo

Outline Wiki MCP Server

by huiseo

batch_create_documents

Create multiple documents simultaneously in Outline wiki to save time when adding content to collections or organizing information.

Instructions

Create multiple documents at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
documentsYes

Implementation Reference

  • The core handler function for batch_create_documents. It checks access, then uses runBatch to create multiple documents via the Outline API's /documents.create endpoint, handling errors for each.
    async batch_create_documents(args: BatchCreateDocumentsInput) {
      checkAccess(config, 'batch_create_documents');
    
      return runBatch(args.documents, async (doc) => {
        try {
          const { data } = await apiCall(() =>
            apiClient.post<OutlineDocument>('/documents.create', {
              title: doc.title,
              text: doc.text,
              collectionId: doc.collectionId,
              parentDocumentId: doc.parentDocumentId,
              publish: doc.publish,
            })
          );
          return { success: true, id: data.id, title: data.title };
        } catch (error) {
          return { success: false, title: doc.title, error: getErrorMessage(error) };
        }
      });
    },
  • Zod input schema for batch_create_documents defining an array of document objects to create.
    export const batchCreateDocumentsSchema = z.object({
      documents: z.array(z.object({
        title: z.string().min(1),
        text: z.string().default(''),
        collectionId,
        parentDocumentId: z.string().uuid().optional(),
        publish: z.boolean().default(true),
      })).min(1, 'At least one document is required'),
    });
  • Tool registration in the allTools array, creating the MCP tool definition from the schema with name and description.
    createTool(
      'batch_create_documents',
      'Create multiple documents at once.',
      'batch_create_documents'
    ),
  • TypeScript type definition inferred from the batchCreateDocumentsSchema for type safety.
    export type BatchCreateDocumentsInput = z.infer<typeof batchCreateDocumentsSchema>;
  • Helper function used by batch_create_documents (and other batch ops) to execute operations in sequence and summarize results.
    async function runBatch<TItem>(
      items: TItem[],
      operation: (item: TItem) => Promise<BatchResult>
    ): Promise<BatchSummary> {
      const results: BatchResult[] = [];
      for (const item of items) {
        results.push(await operation(item));
      }
      const succeeded = results.filter((r) => r.success).length;
      return { total: results.length, succeeded, failed: results.length - succeeded, results };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Create multiple documents at once' implies a write operation but doesn't specify permissions required, whether it's atomic/all-or-nothing, rate limits, or what happens on partial success. The description is too minimal for a mutation tool with zero annotation coverage.

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 maximally concise with a single clear sentence. Every word earns its place by specifying the batch nature of the operation. No wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a batch creation tool with complex nested parameters (5 sub-properties), no annotations, and no output schema, the description is severely incomplete. It doesn't explain the document structure, required fields, default behaviors, or what the tool returns. The minimal description fails to compensate for the missing structured information.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but provides no parameter information. The single 'documents' parameter and its complex nested structure (with 5 sub-properties including required fields) are completely undocumented in the description. This leaves the agent guessing about required formats and constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('create multiple documents') and resource ('documents'), making the purpose immediately understandable. It distinguishes from the sibling 'create_document' by specifying batch functionality. However, it doesn't specify what kind of documents or system context, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'create_document' or other batch operations. It doesn't mention prerequisites, performance considerations, or error handling for partial failures in batch creation.

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/huiseo/outline-smart-mcp'

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