Skip to main content
Glama
aashari

Atlassian Confluence MCP Server

by aashari

Confluence PATCH Request

conf_patch

Update specific Confluence resources like spaces, pages, or comments by sending partial modifications to the Confluence API, with options to optimize response data and reduce token usage.

Instructions

Partially update Confluence resources. Returns TOON format by default.

IMPORTANT - Cost Optimization: Use jq param to filter response fields.

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

Common operations:

  1. Update space: /wiki/api/v2/spaces/{id} body: {"name": "New Name", "description": {"plain": {"value": "Desc", "representation": "plain"}}}

  2. Update comment: /wiki/api/v2/footer-comments/{id}

Note: Confluence v2 API primarily uses PUT for updates.

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_patch' tool with the MCP server, providing title, description, input schema (RequestWithBodyArgs), and the 'patch' handler function created by createWriteHandler.
    server.registerTool(
    	'conf_patch',
    	{
    		title: 'Confluence PATCH Request',
    		description: CONF_PATCH_DESCRIPTION,
    		inputSchema: RequestWithBodyArgs,
    	},
    	patch,
    );
  • Factory creating the MCP-compatible handler for conf_patch (PATCH requests). Parses args, logs, calls controller handlePatch, truncates response, formats as MCP content array, handles errors.
    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);
    		}
    	};
    }
  • Controller handler specifically for conf_patch tool calls, delegates to shared handleRequest with 'PATCH' method.
    export async function handlePatch(
    	options: RequestWithBodyArgsType,
    ): Promise<ControllerResponse> {
    	return handleRequest('PATCH', options);
    }
  • Core execution logic for conf_patch: calls Atlassian API service with PATCH method, applies jq filter if provided, converts to TOON/JSON output.
    async function handleRequest(
    	method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE',
    	options: RequestWithBodyOptions,
    ): Promise<ControllerResponse> {
    	const methodLogger = logger.forMethod(`handle${method}`);
    
    	try {
    		methodLogger.debug(`Making ${method} request`, {
    			path: options.path,
    			...(options.body && { bodyKeys: Object.keys(options.body) }),
    		});
    
    		// Call the service layer (returns TransportResponse with data and rawResponsePath)
    		const response = await atlassianApiService.request<unknown>(
    			options.path,
    			{
    				method,
    				queryParams: options.queryParams,
    				body: options.body,
    			},
    		);
    
    		methodLogger.debug('Successfully received response from service');
    
    		// Apply JQ filter if provided, otherwise return raw data
    		const result = applyJqFilter(response.data, options.jq);
    
    		// Convert to output format (TOON by default, JSON if requested)
    		const useToon = options.outputFormat !== 'json';
    		const content = await toOutputString(result, useToon);
    
    		return {
    			content,
    			rawResponsePath: response.rawResponsePath,
    		};
    	} catch (error) {
    		throw handleControllerError(error, {
    			entityType: 'API',
    			operation: `${method} request`,
    			source: `controllers/atlassian.api.controller.ts@handle${method}`,
    			additionalInfo: { path: options.path },
    		});
    	}
    }
  • Zod schema used as inputSchema for conf_patch tool, defining path, queryParams, jq, outputFormat, and body fields.
    export const RequestWithBodyArgs = z.object({
    	...BaseApiToolArgs,
    	body: bodyField,
    });
    export type RequestWithBodyArgsType = z.infer<typeof RequestWithBodyArgs>;
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by: 1) specifying default return format (TOON) and alternative (JSON), 2) emphasizing cost optimization with jq filtering, 3) providing concrete examples of common operations, and 4) linking to API documentation. It doesn't cover error handling, authentication requirements, or rate limits, but provides substantial behavioral context beyond basic purpose.

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 note, output format, common operations, API reference). It's appropriately sized for a 5-parameter tool with no annotations. Some sentences could be more concise (e.g., the jq explanation is somewhat redundant with schema), but overall it's efficient and front-loads key information about partial updates and cost optimization.

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 mutation tool with 5 parameters, no annotations, and no output schema, the description provides good contextual coverage. It explains the tool's behavior, gives practical examples, addresses cost concerns, and links to external documentation. The main gap is lack of explicit guidance on when to use this vs sibling tools (especially conf_put), but otherwise it's reasonably complete for the complexity level.

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?

With 100% schema description coverage, the baseline is 3. The description adds some value by emphasizing the importance of the 'jq' parameter for cost optimization and providing context about 'outputFormat' choices, but doesn't significantly enhance understanding of the 5 parameters beyond what the schema already documents. The examples help but don't fundamentally change parameter semantics.

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 tool's purpose as 'Partially update Confluence resources' with a specific verb ('update') and resource type ('Confluence resources'). It distinguishes from siblings by specifying PATCH semantics (vs PUT/GET/POST/DELETE), though it doesn't explicitly contrast with each sibling tool. The purpose is clear but could be more specific about what 'partially update' means operationally.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context by mentioning 'Confluence v2 API primarily uses PUT for updates' which implies this PATCH tool is for partial updates when PUT would be for full replacements. However, it doesn't explicitly state when to use this vs conf_put or other siblings, nor does it provide clear when-not-to-use guidance or alternative recommendations. The guidance is implied rather than explicit.

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