Skip to main content
Glama

conf_post

Create pages, blog posts, comments, and labels in Atlassian Confluence using API endpoints to add content to your knowledge base.

Instructions

Create Confluence resources. Returns TOON format by default (token-efficient).

IMPORTANT - Cost Optimization:

  • Use jq param to extract only needed fields from response (e.g., jq: "{id: id, title: title}")

  • Unfiltered responses include all metadata and are expensive!

Output format: TOON (default) or JSON (outputFormat: "json")

Common operations:

  1. Create page: /wiki/api/v2/pages body: {"spaceId": "123456", "status": "current", "title": "Page Title", "parentId": "789", "body": {"representation": "storage", "value": "<p>Content</p>"}}

  2. Create blog post: /wiki/api/v2/blogposts body: {"spaceId": "123456", "status": "current", "title": "Blog Title", "body": {"representation": "storage", "value": "<p>Content</p>"}}

  3. Add label: /wiki/api/v2/pages/{id}/labels - body: {"name": "label-name"}

  4. Add comment: /wiki/api/v2/pages/{id}/footer-comments

API reference: https://developer.atlassian.com/cloud/confluence/rest/v2/

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesThe Confluence API endpoint path (without base URL). Must start with "/". Examples: "/wiki/api/v2/spaces", "/wiki/api/v2/pages", "/wiki/api/v2/pages/{id}"
queryParamsNoOptional query parameters as key-value pairs. Examples: {"limit": "25", "cursor": "...", "space-id": "123", "body-format": "storage"}
jqNoJMESPath expression to filter/transform the response. IMPORTANT: Always use this to extract only needed fields and reduce token costs. Examples: "results[*].{id: id, title: title}" (extract specific fields), "results[0]" (first result), "results[*].id" (IDs only). See https://jmespath.org
outputFormatNoOutput format: "toon" (default, 30-60% fewer tokens) or "json". TOON is optimized for LLMs with tabular arrays and minimal syntax.
bodyYesRequest body as a JSON object. Structure depends on the endpoint. Example for page: {"spaceId": "123", "title": "Page Title", "body": {"representation": "storage", "value": "<p>Content</p>"}}

Implementation Reference

  • Registers the 'conf_post' MCP tool with title, description, input schema (RequestWithBodyArgs), and the 'post' handler function.
    server.registerTool( 'conf_post', { title: 'Confluence POST Request', description: CONF_POST_DESCRIPTION, inputSchema: RequestWithBodyArgs, }, post, );
  • Zod schema definition for input arguments to conf_post (and other write tools), including path, queryParams, jq, outputFormat, and body.
    export const RequestWithBodyArgs = z.object({ ...BaseApiToolArgs, body: bodyField, }); export type RequestWithBodyArgsType = z.infer<typeof RequestWithBodyArgs>;
  • The handlePost function, which is passed to the tool handler creator and executes the POST-specific logic by calling the generic handleRequest.
    export async function handlePost( options: RequestWithBodyArgsType, ): Promise<ControllerResponse> { return handleRequest('POST', options); }
  • createWriteHandler creates the actual MCP tool executor function for POST/PUT/PATCH tools like conf_post. It logs args, calls the controller handler, truncates response for AI, handles errors, and formats MCP content response.
    function createWriteHandler( methodName: string, handler: ( options: RequestWithBodyArgsType, ) => Promise<{ content: string; rawResponsePath?: string | null }>, ) { return async (args: Record<string, unknown>) => { const methodLogger = Logger.forContext( 'tools/atlassian.api.tool.ts', methodName.toLowerCase(), ); methodLogger.debug(`Making ${methodName} request with args:`, { path: args.path, bodyKeys: args.body ? Object.keys(args.body as object) : [], }); try { const result = await handler(args as RequestWithBodyArgsType); methodLogger.debug( 'Successfully received response from controller', ); return { content: [ { type: 'text' as const, text: truncateForAI( result.content, result.rawResponsePath, ), }, ], }; } catch (error) { methodLogger.error(`Failed to make ${methodName} request`, error); return formatErrorForMcpTool(error); } }; }
  • src/index.ts:65-65 (registration)
    Top-level call to register all Atlassian API tools, including conf_post, during MCP server initialization.
    atlassianApiTools.registerTools(serverInstance);

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/aashari/mcp-server-atlassian-confluence'

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