Skip to main content
Glama
aaronsb

Confluence MCP Server

find_confluence_page

Retrieve a Confluence page by its exact title to access content in markdown format and metadata. Specify a space ID to narrow search scope, or get a list of matches for multiple pages with the same title.

Instructions

Find and retrieve a Confluence page by its title. Returns the page content in markdown format, along with metadata. Optionally specify a spaceId to narrow the search. If multiple pages match the title, returns a list of matches to choose from. TIP: Use this when you know the exact page title, but prefer search_confluence_pages for partial matches.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the page to find
spaceIdNoOptional space ID to limit the search scope

Implementation Reference

  • The main handler function that implements the find_confluence_page tool logic: searches for pages by title, handles single/multiple/no matches, fetches and converts content to markdown, returns structured response.
    export async function handleFindConfluencePage(
      client: ConfluenceClient,
      args: { title: string; spaceId?: string }
    ): Promise<{
      content: Array<{ type: "text"; text: string }>;
    }> {
      try {
        if (!args.title) {
          throw new McpError(ErrorCode.InvalidParams, "title is required");
        }
    
        const pages = await client.searchPageByName(args.title, args.spaceId);
        
        if (pages.length === 0) {
          throw new McpError(
            ErrorCode.InvalidParams,
            `No pages found with title "${args.title}"`
          );
        }
    
        if (pages.length > 1) {
          // If multiple pages found, return a list of matches
          const matches = pages.map(page => ({
            id: page.id,
            title: page.title,
            spaceId: page.spaceId,
            url: page._links.webui
          }));
          
          throw new McpError(
            ErrorCode.InvalidParams,
            `Multiple pages found with title "${args.title}". Please use get_confluence_page with one of these IDs: ${JSON.stringify(matches)}`
          );
        }
    
        // Get the full page content for the single match
        const page = await client.getConfluencePage(pages[0].id);
        
        if (!page.body?.storage?.value) {
          throw new McpError(
            ErrorCode.InternalError,
            "Page content is empty"
          );
        }
    
        const markdownContent = convertStorageToMarkdown(page.body.storage.value);
        const simplified = convertToSimplifiedPage(page, markdownContent);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(simplified),
            },
          ],
        };
      } catch (error) {
        console.error("Error getting page by name:", error instanceof Error ? error.message : String(error));
        if (error instanceof McpError) {
          throw error;
        }
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to get page: ${error instanceof Error ? error.message : String(error)}`
        );
      }
    }
  • Zod/input schema definition and description for the find_confluence_page tool, defining parameters title (required) and spaceId (optional).
    find_confluence_page: {
      description: "Find and retrieve a Confluence page by its title. Returns the page content in markdown format, along with metadata. Optionally specify a spaceId to narrow the search. If multiple pages match the title, returns a list of matches to choose from. TIP: Use this when you know the exact page title, but prefer search_confluence_pages for partial matches.",
      inputSchema: {
        type: "object",
        properties: {
          title: {
            type: "string",
            description: "Title of the page to find",
          },
          spaceId: {
            type: "string",
            description: "Optional space ID to limit the search scope",
          },
        },
        required: ["title"],
      },
    },
  • src/index.ts:219-223 (registration)
    Tool registration in the MCP server request handler switch statement, mapping 'find_confluence_page' calls to the handleFindConfluencePage function.
    case "find_confluence_page": {
      const { title, spaceId } = (args || {}) as { title: string; spaceId?: string };
      if (!title) throw new McpError(ErrorCode.InvalidParams, "title is required");
      return await handleFindConfluencePage(this.confluenceClient, { title, spaceId });
    }
  • Helper function to convert full Page object and markdown content into the simplified response format used by the handler.
    function convertToSimplifiedPage(page: Page, markdownContent: string): SimplifiedPage {
      return {
        title: page.title,
        content: markdownContent,
        metadata: {
          id: page.id,
          spaceId: page.spaceId,
          version: page.version.number,
          lastModified: page.version.createdAt,
          url: page._links.webui
        }
      };
    }
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 describes the return format ('page content in markdown format, along with metadata'), handling of multiple matches ('returns a list of matches to choose from'), and optional parameter behavior ('optionally specify a spaceId to narrow the search'). However, it doesn't mention potential limitations like rate limits, authentication requirements, or error conditions.

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

Conciseness5/5

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

The description is efficiently structured with three sentences that each add value: the core functionality, optional parameter behavior, multiple match handling, and usage guidance. There's no wasted text, and key information is front-loaded.

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 read-only tool with no output schema, the description does well by explaining the return format and multi-match behavior. However, without annotations or output schema, it could benefit from more detail on error cases or response structure. The context signals indicate moderate complexity (2 parameters, no enums), and the description covers most essential aspects.

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?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds minimal value beyond the schema by mentioning the optional nature of spaceId and its purpose ('to narrow the search'), but doesn't provide additional syntax or format details. This meets the baseline for high schema coverage.

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 specific action ('find and retrieve'), resource ('Confluence page'), and key constraint ('by its title'). It explicitly distinguishes from sibling 'search_confluence_pages' for partial matches, making the purpose unambiguous and well-differentiated.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('when you know the exact page title') and when to use an alternative ('prefer search_confluence_pages for partial matches'). This gives clear context for tool selection among siblings.

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/aaronsb/confluence-cloud-mcp'

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