Skip to main content
Glama
aashari

Atlassian Confluence MCP Server

by aashari

Confluence PUT Request

conf_put

Update Confluence pages and blog posts by replacing entire resources. Use this tool to modify content, titles, and metadata while managing version numbers.

Instructions

Replace Confluence resources (full update). Returns TOON format by default.

IMPORTANT - Cost Optimization:

  • Use jq param to extract only needed fields from response

  • Example: jq: "{id: id, version: version.number}"

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

Common operations:

  1. Update page: /wiki/api/v2/pages/{id} body: {"id": "123", "status": "current", "title": "Updated Title", "spaceId": "456", "body": {"representation": "storage", "value": "<p>Content</p>"}, "version": {"number": 2}} Note: version.number must be incremented

  2. Update blog post: /wiki/api/v2/blogposts/{id}

Note: PUT replaces entire resource. Version number must be incremented.

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_put' tool with the MCP server, specifying its title, description, Zod input schema (RequestWithBodyArgs), and the 'put' handler function.
    server.registerTool(
    	'conf_put',
    	{
    		title: 'Confluence PUT Request',
    		description: CONF_PUT_DESCRIPTION,
    		inputSchema: RequestWithBodyArgs,
    	},
    	put,
    );
  • The handlePut controller function that executes the PUT logic for the conf_put tool by invoking the shared handleRequest with method 'PUT'.
    /**
     * Generic PUT request to Confluence API
     *
     * @param options - Options containing path, body, queryParams, and optional jq filter
     * @returns Promise with raw JSON response (optionally filtered)
     */
    export async function handlePut(
    	options: RequestWithBodyArgsType,
    ): Promise<ControllerResponse> {
    	return handleRequest('PUT', options);
    }
  • Zod schema definition (RequestWithBodyArgs) used as inputSchema for the conf_put tool, including path, queryParams, jq, outputFormat, and body fields.
    export const RequestWithBodyArgs = z.object({
    	...BaseApiToolArgs,
    	body: bodyField,
    });
    export type RequestWithBodyArgsType = z.infer<typeof RequestWithBodyArgs>;
  • createWriteHandler function that constructs the MCP tool executor for conf_put ('PUT'), handling logging, controller invocation (handlePut), response truncation, MCP content formatting, and error handling.
    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);
    		}
    	};
    }
  • Description string for the conf_put tool, providing usage instructions, examples, and optimization tips, referenced in tool registration.
    const CONF_PUT_DESCRIPTION = `Replace Confluence resources (full update). Returns TOON format by default.
    
    **IMPORTANT - Cost Optimization:**
    - Use \`jq\` param to extract only needed fields from response
    - Example: \`jq: "{id: id, version: version.number}"\`
    
    **Output format:** TOON (default) or JSON (\`outputFormat: "json"\`)
    
    **Common operations:**
    
    1. **Update page:** \`/wiki/api/v2/pages/{id}\`
       body: \`{"id": "123", "status": "current", "title": "Updated Title", "spaceId": "456", "body": {"representation": "storage", "value": "<p>Content</p>"}, "version": {"number": 2}}\`
       Note: version.number must be incremented
    
    2. **Update blog post:** \`/wiki/api/v2/blogposts/{id}\`
    
    Note: PUT replaces entire resource. Version number must be incremented.
    
    API reference: https://developer.atlassian.com/cloud/confluence/rest/v2/`;
Behavior4/5

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

With no annotations provided, the description carries full burden and delivers substantial behavioral context. It discloses that PUT replaces entire resources, requires version number increments, returns TOON format by default, and includes important cost optimization guidance about using jq parameter. It also provides API reference and example operations. The only gap is lack of explicit mention about authentication requirements or rate limits.

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

Conciseness4/5

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

The description is well-structured with clear sections (IMPORTANT, Output format, Common operations) and front-loaded key information. Every sentence serves a purpose, though the detailed API reference and multiple examples make it somewhat lengthy. The information density is high with minimal redundancy.

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

Completeness4/5

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

For a complex mutation tool with 5 parameters, no annotations, and no output schema, the description provides substantial context. It covers behavioral traits, parameter usage guidance, cost optimization, and practical examples. The main gap is the absence of explicit information about error handling, response structure, or authentication requirements, which would be helpful for a PUT operation.

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

Parameters4/5

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

With 100% schema description coverage, the baseline is 3, but the description adds significant value beyond the schema. It provides concrete examples for jq usage with cost optimization context, explains the importance of outputFormat choice for token efficiency, and gives detailed endpoint examples with body structures. The description transforms schema definitions into practical usage guidance.

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 description clearly states the tool's purpose: 'Replace Confluence resources (full update)' which is a specific verb+resource combination. It distinguishes from siblings by emphasizing PUT semantics (full replacement) versus PATCH (partial update) or POST (create). The title 'Confluence PUT Request' reinforces this distinction.

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?

The description provides clear context about when to use this tool: for full updates where version numbers must be incremented. It mentions common operations like updating pages and blog posts. However, it doesn't explicitly contrast when to use PUT versus PATCH (conf_patch) or POST (conf_post) beyond the 'full update' characterization, missing explicit sibling differentiation.

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

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