Skip to main content
Glama

create_paragraph_bullets

Destructive

Convert Google Docs paragraph ranges into bulleted or numbered lists with explicit nesting depth, handling existing-list quirks so repeated calls keep levels stable.

Instructions

Turn one or more paragraph ranges into a bulleted or numbered list, with explicit nesting depth.

Wraps the Docs API's createParagraphBullets/deleteParagraphBullets requests, working around two confirmed-live API quirks:

  • createParagraphBullets is a no-op on a paragraph that's already part of a list — it neither changes the existing nesting level nor consumes any leading tab characters meant to signal a new one (they're left behind as literal text). Every paragraph this tool touches is deleteParagraphBullets'd first (harmless even if it wasn't previously a list item) so createParagraphBullets always applies to a clean, non-list paragraph. deleteParagraphBullets keeps a removed item's indent, which createParagraphBullets would read as extra depth, so the tool also zeroes each paragraph's indentation before bulleting it. nesting_level is therefore absolute: repeating the same call changes nothing.

  • createParagraphBullets has no nestingLevel field of its own — the API infers each paragraph's depth from its own leading tab characters, but only relative to whatever ELSE is included in that same call. A paragraph immediately adjacent to an existing list item that call doesn't also cover gets pulled back to that neighbor's level regardless of its own tabs (the same class of bug PR #432 fixed in this project's own markdown-to-Doc converter). To keep every requested paragraph's relative depth correct, this tool fetches the document, resolves each requested range to the paragraph(s) it covers, and — for any that are already part of a list — expands the affected span to include their full contiguous run of same-list neighbors (preserving each neighbor's own current nesting level unchanged). Contiguous spans sharing one bullet preset are then submitted as a single createParagraphBullets call each, applied in descending document-position order so no not-yet-processed span's indices are invalidated by an earlier span's tab insertions. A span in which every paragraph sits at nesting_level > 0 (no level-0 member to anchor the API's relative depth inference) is wrapped with a throwaway 0-tab anchor paragraph that is bulleted alongside the real items and then deleted, so the items land at their true nesting level instead of collapsing to 0 (issue #713; the same fix emitter.py carries for #439).

Use get_doc_structure to obtain start_index/end_index for each target range — typically one paragraph's own startIndex/endIndex, or a contiguous span covering several (all promoted to the same nesting_level/bullet_preset). For independent depths per paragraph, pass one range per paragraph.

Args: doc_id: The Google Doc file ID. ranges: List of range dicts, each with: start_index (int), end_index (int): from get_doc_structure — must overlap at least one existing paragraph. bullet_preset (str, optional): "BULLET_DISC_CIRCLE_SQUARE" (unordered) or "NUMBERED_DECIMAL_ALPHA_ROMAN" (ordered) — the only two presets this codebase has confirmed live (see emitter.py). The Docs API defines additional glyph/numbering presets not exercised here; pass the literal API enum string to use one anyway. If omitted, an already-listed target paragraph keeps its existing list's own style (read from the document's own lists map) rather than silently being converted to a different one; a paragraph with no existing list falls back to "BULLET_DISC_CIRCLE_SQUARE". nesting_level (int, optional): 0 = top-level (default), 1 = one level indented, etc. Must be >= 0.

Returns: Confirmation with docId and count of batchUpdate requests sent. {"error": ...} if ranges is empty, a nesting_level is negative, a range doesn't overlap any paragraph, two explicitly-requested contiguous paragraphs specify conflicting presets, or the Docs API call fails.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc_id": "<doc_id>",
      "ranges": "<ranges>"
    },
    "name": "create_paragraph_bullets"
  }
}

Input Schema

NameRequiredDescriptionDefault
doc_idYes
rangesYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only give destructiveHint=true, but the description goes far beyond: it discloses that every touched paragraph is first deleteParagraphBullets'd and has its indentation zeroed, that nesting_level is absolute so repeat calls are idempotent, and that spans may be expanded to include neighboring list items. It also enumerates the error conditions that return {"error": ...}. This is exactly the mutation-side context the annotation alone cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and the Args/Returns structure is clear, but the bulk of the middle is implementation rationale citing PR #432, issue #713, and emitter.py — references an agent cannot act on and that push the definition well past the size needed to select and call the tool. The useful guarantees (idempotency, absolute nesting) could be stated in a fraction of the words.

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

Completeness5/5

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

For a complex, destructive document-mutation tool with a 0%-coverage schema, the definition covers invocation inputs, the preprocessing behavior, idempotency guarantees, preset fallbacks, and the specific failure modes. An output schema exists, so the Returns note is a bonus rather than a necessity.

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

Parameters5/5

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

Schema description coverage is 0% — the schema is a bare doc_id plus an untyped ranges array — so the description carries the full burden and does so: it documents start_index/end_index provenance, the two confirmed bullet_preset values plus the fallback behavior when omitted, and nesting_level's zero-based semantics with its >= 0 constraint. The nested range fields the schema leaves opaque are fully explained.

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 first sentence states a specific verb and resource — 'Turn one or more paragraph ranges into a bulleted or numbered list, with explicit nesting depth' — and the sibling delete_paragraph_bullets is clearly the inverse operation. An agent can tell exactly what this does without opening the schema.

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?

It explicitly routes the agent to get_doc_structure for indices and explains the key selection decision — one range per paragraph for independent depths versus a contiguous span for a shared preset. It does not explicitly state when not to use this tool (e.g., to remove bullets, use delete_paragraph_bullets), which keeps it short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools