Skip to main content
Glama
huiseo

Outline Wiki MCP Server

by huiseo

batch_update_documents

Update multiple Outline wiki documents simultaneously to modify titles, content, or append text in bulk operations.

Instructions

Update multiple documents at once.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYes

Implementation Reference

  • The core handler function that implements the batch_update_documents tool logic. It processes a list of updates, handling title changes, text updates (with optional append mode), and reports success/failure for each using the shared runBatch utility.
    async batch_update_documents(args: BatchUpdateDocumentsInput) {
      checkAccess(config, 'batch_update_documents');
    
      return runBatch(args.updates, async (update) => {
        try {
          let text = update.text;
          if (update.append && update.text) {
            const { data: existing } = await apiCall(() =>
              apiClient.post<OutlineDocument>('/documents.info', { id: update.documentId })
            );
            text = (existing.text || '') + '\n\n' + update.text;
          }
    
          const payload: Record<string, unknown> = { id: update.documentId };
          if (update.title) payload.title = update.title;
          if (text !== undefined) payload.text = text;
    
          const { data } = await apiCall(() =>
            apiClient.post<OutlineDocument>('/documents.update', payload)
          );
          return { success: true, id: data.id, title: data.title };
        } catch (error) {
          return { success: false, documentId: update.documentId, error: getErrorMessage(error) };
        }
      });
    },
  • Zod schema defining the input structure for batch_update_documents, including an array of updates each with documentId, optional title/text, and append flag.
    export const batchUpdateDocumentsSchema = z.object({
      updates: z.array(z.object({
        documentId,
        title: z.string().min(1).optional(),
        text: z.string().optional(),
        append: z.boolean().default(false),
      })).min(1, 'At least one update is required'),
    });
  • Tool registration in the allTools array using createTool, which converts the Zod schema to JSON Schema for MCP tool definition.
    createTool(
      'batch_update_documents',
      'Update multiple documents at once.',
      'batch_update_documents'
    ),
  • TypeScript type derived from the batchUpdateDocumentsSchema for use in handler signatures.
    export type BatchUpdateDocumentsInput = z.infer<typeof batchUpdateDocumentsSchema>;
  • Inclusion of the schema in the central toolSchemas map, referenced by tools.ts for JSON Schema conversion.
    batch_update_documents: batchUpdateDocumentsSchema,
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic operation. It doesn't disclose behavioral traits such as permissions required, whether updates are atomic or partial, error handling for failed updates, rate limits, or what happens to unspecified fields. 'Update' implies mutation but lacks critical details for safe usage.

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 a single, efficient sentence with zero waste. It's appropriately sized and front-loaded, directly conveying the core functionality without 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?

Given the complexity of a batch mutation tool with no annotations, 0% schema coverage, and no output schema, the description is incomplete. It lacks details on usage context, parameter semantics, behavioral implications, and expected outcomes, making it inadequate for safe and effective tool selection.

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 adds no parameter information. It doesn't explain the 'updates' array structure, required 'documentId', optional fields like 'title' and 'text', or the 'append' boolean behavior. The description fails to provide meaning beyond the bare schema.

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 'Update multiple documents at once' clearly states the action (update) and resource (documents) with a specific scope (multiple/batch). It distinguishes from single-document updates like 'update_document' by emphasizing batch capability, though it doesn't explicitly name alternatives.

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?

No guidance is provided on when to use this tool versus alternatives like 'update_document' or 'batch_create_documents'. The description implies batch operations but doesn't specify prerequisites, constraints, or comparative use cases with sibling tools.

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