Automate Confluence page creation, content search, space management, labels, and hierarchy navigation via Rube MCP (Composio). Always search tools first for current schemas.
Add this skill
npx mdskills install sickn33/confluence-automationComprehensive Confluence automation with detailed workflows, pitfall warnings, and CQL guidance
1---2name: confluence-automation3description: "Automate Confluence page creation, content search, space management, labels, and hierarchy navigation via Rube MCP (Composio). Always search tools first for current schemas."4requires:5 mcp: [rube]6---78# Confluence Automation via Rube MCP910Automate Confluence operations including page creation and updates, content search with CQL, space management, label tagging, and page hierarchy navigation through Composio's Confluence toolkit.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Confluence connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `confluence`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `confluence`253. If connection is not ACTIVE, follow the returned auth link to complete Confluence OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Create and Update Pages3132**When to use**: User wants to create new documentation or update existing Confluence pages3334**Tool sequence**:351. `CONFLUENCE_GET_SPACES` - List spaces to find the target space ID [Prerequisite]362. `CONFLUENCE_SEARCH_CONTENT` - Find existing page to avoid duplicates or locate parent [Optional]373. `CONFLUENCE_GET_PAGE_BY_ID` - Get current page content and version number before updating [Prerequisite for updates]384. `CONFLUENCE_CREATE_PAGE` - Create a new page in a space [Required for creation]395. `CONFLUENCE_UPDATE_PAGE` - Update an existing page with new content and incremented version [Required for updates]406. `CONFLUENCE_ADD_CONTENT_LABEL` - Tag the page with labels after creation [Optional]4142**Key parameters**:43- `spaceId`: Space ID or key (e.g., `"DOCS"`, `"12345678"`) -- space keys are auto-converted to IDs44- `title`: Page title (must be unique within a space)45- `parentId`: Parent page ID for creating child pages; omit to place under space homepage46- `body.storage.value`: HTML/XHTML content in Confluence storage format47- `body.storage.representation`: Must be `"storage"` for create operations48- `version.number`: For updates, must be current version + 149- `version.message`: Optional change description5051**Pitfalls**:52- Confluence enforces unique page titles per space; creating a page with a duplicate title will fail53- `UPDATE_PAGE` requires `version.number` set to current version + 1; always fetch current version first with `GET_PAGE_BY_ID`54- Content must be in Confluence storage format (XHTML), not plain text or Markdown55- `CREATE_PAGE` uses `body.storage.value` while `UPDATE_PAGE` uses `body.value` with `body.representation`56- `GET_PAGE_BY_ID` requires a numeric long ID, not a UUID or string5758### 2. Search Content5960**When to use**: User wants to find pages, blog posts, or content across Confluence6162**Tool sequence**:631. `CONFLUENCE_SEARCH_CONTENT` - Keyword search with intelligent relevance ranking [Required]642. `CONFLUENCE_CQL_SEARCH` - Advanced search using Confluence Query Language [Alternative]653. `CONFLUENCE_GET_PAGE_BY_ID` - Hydrate full content for selected search results [Optional]664. `CONFLUENCE_GET_PAGES` - Browse pages sorted by date when search relevance is weak [Fallback]6768**Key parameters for SEARCH_CONTENT**:69- `query`: Search text matched against page titles with intelligent ranking70- `spaceKey`: Limit search to a specific space71- `limit`: Max results (default 25, max 250)72- `start`: Pagination offset (0-based)7374**Key parameters for CQL_SEARCH**:75- `cql`: CQL query string (e.g., `text ~ "API docs" AND space = DOCS AND type = page`)76- `expand`: Comma-separated properties (e.g., `content.space`, `content.body.storage`)77- `excerpt`: `highlight`, `indexed`, or `none`78- `limit`: Max results (max 250; reduced to 25-50 when using body expansions)7980**CQL operators and fields**:81- Fields: `text`, `title`, `label`, `space`, `type`, `creator`, `lastModified`, `created`, `ancestor`82- Operators: `=`, `!=`, `~` (contains), `!~`, `>`, `<`, `>=`, `<=`, `IN`, `NOT IN`83- Functions: `currentUser()`, `now("-7d")`, `now("-30d")`84- Example: `title ~ "meeting" AND lastModified > now("-7d") ORDER BY lastModified DESC`8586**Pitfalls**:87- `CONFLUENCE_SEARCH_CONTENT` fetches up to 300 pages and applies client-side filtering -- not a true full-text search88- `CONFLUENCE_CQL_SEARCH` is the real full-text search; use `text ~ "term"` for content body search89- HTTP 429 rate limits can occur; throttle to ~2 requests/second with backoff90- Using body expansions in CQL_SEARCH may reduce max results to 25-5091- Search indexing is not immediate; recently created pages may not appear9293### 3. Manage Spaces9495**When to use**: User wants to list, create, or inspect Confluence spaces9697**Tool sequence**:981. `CONFLUENCE_GET_SPACES` - List all spaces with optional filtering [Required]992. `CONFLUENCE_GET_SPACE_BY_ID` - Get detailed metadata for a specific space [Optional]1003. `CONFLUENCE_CREATE_SPACE` - Create a new space with key and name [Optional]1014. `CONFLUENCE_GET_SPACE_PROPERTIES` - Retrieve custom metadata stored as space properties [Optional]1025. `CONFLUENCE_GET_SPACE_CONTENTS` - List pages, blog posts, or attachments in a space [Optional]1036. `CONFLUENCE_GET_LABELS_FOR_SPACE` - List labels on a space [Optional]104105**Key parameters**:106- `key`: Space key -- alphanumeric only, no underscores or hyphens (e.g., `DOCS`, `PROJECT1`)107- `name`: Human-readable space name108- `type`: `global` or `personal`109- `status`: `current` (active) or `archived`110- `spaceKey`: For GET_SPACE_CONTENTS, filters by space key111- `id`: Numeric space ID for GET_SPACE_BY_ID (NOT the space key)112113**Pitfalls**:114- Space keys must be alphanumeric only (no underscores, hyphens, or special characters)115- `GET_SPACE_BY_ID` requires numeric space ID, not the space key; use `GET_SPACES` to find numeric IDs116- Clickable space URLs may need assembly: join `_links.webui` (relative) with `_links.base`117- Default pagination is 25; set `limit` explicitly (max 200 for spaces)118119### 4. Navigate Page Hierarchy and Labels120121**When to use**: User wants to explore page trees, child pages, ancestors, or manage labels122123**Tool sequence**:1241. `CONFLUENCE_SEARCH_CONTENT` - Find the target page ID [Prerequisite]1252. `CONFLUENCE_GET_CHILD_PAGES` - List direct children of a parent page [Required]1263. `CONFLUENCE_GET_PAGE_ANCESTORS` - Get the full ancestor chain for a page [Optional]1274. `CONFLUENCE_GET_LABELS_FOR_PAGE` - List labels on a specific page [Optional]1285. `CONFLUENCE_ADD_CONTENT_LABEL` - Add labels to a page [Optional]1296. `CONFLUENCE_GET_LABELS_FOR_SPACE_CONTENT` - List labels across all content in a space [Optional]1307. `CONFLUENCE_GET_PAGE_VERSIONS` - Audit edit history for a page [Optional]131132**Key parameters**:133- `id`: Page ID for child pages, ancestors, labels, and versions134- `cursor`: Opaque pagination cursor for GET_CHILD_PAGES (from `_links.next`)135- `limit`: Items per page (max 250 for child pages)136- `sort`: Child page sort options: `id`, `-id`, `created-date`, `-created-date`, `modified-date`, `-modified-date`, `child-position`, `-child-position`137138**Pitfalls**:139- `GET_CHILD_PAGES` only returns direct children, not nested descendants; recurse for full tree140- Pagination for GET_CHILD_PAGES uses cursor-based pagination (not start/limit)141- Verify the correct page ID from search before using as parent; search can return similar titles142- `GET_PAGE_VERSIONS` requires the page ID, not a version number143144## Common Patterns145146### ID Resolution147Always resolve human-readable names to IDs before operations:148- **Space key -> Space ID**: `CONFLUENCE_GET_SPACES` with `spaceKey` filter, or `CREATE_PAGE` accepts space keys directly149- **Page title -> Page ID**: `CONFLUENCE_SEARCH_CONTENT` with `query` param, then extract page ID150- **Space ID from URL**: Extract numeric ID from Confluence URLs or use GET_SPACES151152### Pagination153Confluence uses two pagination styles:154- **Offset-based** (most endpoints): `start` (0-based offset) + `limit` (page size). Increment `start` by `limit` until fewer results than `limit` are returned.155- **Cursor-based** (GET_CHILD_PAGES, GET_PAGES): Use the `cursor` from `_links.next` in the response. Continue until no `next` link is present.156157### Content Formatting158- Pages use Confluence storage format (XHTML), not Markdown159- Basic elements: `<p>`, `<h1>`-`<h6>`, `<strong>`, `<em>`, `<code>`, `<ul>`, `<ol>`, `<li>`160- Tables: `<table><tbody><tr><th>` / `<td>` structure161- Macros: `<ac:structured-macro ac:name="code">` for code blocks, etc.162- Always wrap content in proper XHTML tags163164## Known Pitfalls165166### ID Formats167- Space IDs are numeric (e.g., `557060`); space keys are short strings (e.g., `DOCS`)168- Page IDs are numeric long values for GET_PAGE_BY_ID; some tools accept UUID format169- `GET_SPACE_BY_ID` requires numeric ID, not the space key170- `GET_PAGE_BY_ID` takes an integer, not a string171172### Rate Limits173- HTTP 429 can occur on search endpoints; honor Retry-After header174- Throttle to ~2 requests/second with exponential backoff and jitter175- Body expansion in CQL_SEARCH reduces result limits to 25-50176177### Content Format178- Content must be Confluence storage format (XHTML), not Markdown or plain text179- Invalid XHTML will cause page creation/update to fail180- `CREATE_PAGE` nests body under `body.storage.value`; `UPDATE_PAGE` uses `body.value` + `body.representation`181182### Version Conflicts183- Updates require exact next version number (current + 1)184- Concurrent edits can cause version conflicts; always fetch current version immediately before updating185- Title changes during update must still be unique within the space186187## Quick Reference188189| Task | Tool Slug | Key Params |190|------|-----------|------------|191| List spaces | `CONFLUENCE_GET_SPACES` | `type`, `status`, `limit` |192| Get space by ID | `CONFLUENCE_GET_SPACE_BY_ID` | `id` |193| Create space | `CONFLUENCE_CREATE_SPACE` | `key`, `name`, `type` |194| Space contents | `CONFLUENCE_GET_SPACE_CONTENTS` | `spaceKey`, `type`, `status` |195| Space properties | `CONFLUENCE_GET_SPACE_PROPERTIES` | `id`, `key` |196| Search content | `CONFLUENCE_SEARCH_CONTENT` | `query`, `spaceKey`, `limit` |197| CQL search | `CONFLUENCE_CQL_SEARCH` | `cql`, `expand`, `limit` |198| List pages | `CONFLUENCE_GET_PAGES` | `spaceId`, `sort`, `limit` |199| Get page by ID | `CONFLUENCE_GET_PAGE_BY_ID` | `id` (integer) |200| Create page | `CONFLUENCE_CREATE_PAGE` | `title`, `spaceId`, `body` |201| Update page | `CONFLUENCE_UPDATE_PAGE` | `id`, `title`, `body`, `version` |202| Delete page | `CONFLUENCE_DELETE_PAGE` | `id` |203| Child pages | `CONFLUENCE_GET_CHILD_PAGES` | `id`, `limit`, `sort` |204| Page ancestors | `CONFLUENCE_GET_PAGE_ANCESTORS` | `id` |205| Page labels | `CONFLUENCE_GET_LABELS_FOR_PAGE` | `id` |206| Add label | `CONFLUENCE_ADD_CONTENT_LABEL` | content ID, label |207| Page versions | `CONFLUENCE_GET_PAGE_VERSIONS` | `id` |208| Space labels | `CONFLUENCE_GET_LABELS_FOR_SPACE` | space ID |209
Full transparency — inspect the skill content before installing.