Skip to main content
Glama
huiseo
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 primary handler function for the 'batch_update_documents' tool. It processes a list of document updates, handles optional text appending by fetching existing content, constructs the API payload, calls the Outline API's documents.update endpoint for each, and returns batch results with success/failure status.
    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 definition for the batch_update_documents tool input, validating an array of updates each containing 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'),
    });
  • Registration of the 'batch_update_documents' tool in the allTools array, creating its JSON schema definition from the Zod schema for MCP protocol.
    createTool(
      'batch_update_documents',
      'Update multiple documents at once.',
      'batch_update_documents'
    ),
  • Generic helper function runBatch used by batch_update_documents (and other batch handlers) to execute operations on an array of items and aggregate results into a BatchSummary.
    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 };
    }
  • Mapping of the batch_update_documents tool name to its Zod schema in the central toolSchemas record.
    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 permissions needed, whether updates are atomic/partial, error handling for failed updates, rate limits, or what happens to documents not in the updates array. 'Update' implies mutation but lacks behavioral details.

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?

Extremely concise with a single sentence that directly states the tool's purpose. No wasted words or unnecessary elaboration, though this conciseness comes at the cost of detail.

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 mutation tool with 1 parameter (complex array), 0% schema coverage, no annotations, and no output schema, the description is inadequate. It doesn't explain the updates parameter structure, return values, error conditions, or how it differs from sibling batch tools, leaving significant gaps for agent understanding.

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 0%, so the description must compensate but only mentions 'multiple documents' without explaining the updates array structure or parameters like documentId, title, text, append. It adds minimal value beyond the schema's property names, failing to clarify parameter meanings or usage.

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 ('update') and resource ('multiple documents'), with 'at once' implying batch processing. It distinguishes from single-document updates but doesn't explicitly differentiate from other batch operations like batch_archive_documents or batch_delete_documents.

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 on when to use this tool versus alternatives like update_document for single updates or other batch operations. The description implies batch context but provides no explicit when/when-not criteria or prerequisite conditions.

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-wiki-mcp'

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