Skip to main content
Glama
akhilthomas236

MCP Jira & Confluence Server

ask-confluence-page

Ask questions about Confluence page content to extract specific information using page ID, title, or space key.

Instructions

Ask a question about a specific Confluence page content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idNoThe ID of the Confluence page
titleNoThe title of the Confluence page
space_keyNoThe key of the Confluence space
questionNoThe question to ask about the page content
context_typeNoType of context needed to answer the questionsummary

Implementation Reference

  • Tool 'ask-confluence-page' is registered in the list_tools handler with its name, description, and input schema definition.
    types.Tool(
        name="ask-confluence-page",
        description="Ask a question about a specific Confluence page content",
        inputSchema={
            "type": "object",
            "properties": {
                "page_id": {"type": "string", "description": "The ID of the Confluence page"},
                "title": {"type": "string", "description": "The title of the Confluence page"},
                "space_key": {"type": "string", "description": "The key of the Confluence space"},
                "question": {"type": "string", "description": "The question to ask about the page content"},
                "context_type": {
                    "type": "string", 
                    "enum": ["summary", "details", "specific"],
                    "default": "summary",
                    "description": "Type of context needed to answer the question"
                }
            },
            "anyOf": [
                {"required": ["page_id", "question"]},
                {"required": ["title", "space_key", "question"]}
            ]
        }
    ),
  • Handler implementation for 'ask-confluence-page' tool. Fetches a Confluence page by ID or title+space_key, converts content to markdown, and returns relevant context to answer the user's question. Supports three context types: summary, details, and specific.
    elif name == "ask-confluence-page":
        page_id = arguments.get("page_id")
        title = arguments.get("title")
        space_key = arguments.get("space_key")
        question = arguments.get("question")
        context_type = arguments.get("context_type", "summary")
        
        if not question:
            raise ValueError("Missing required argument: question")
            
        if not page_id and (not title or not space_key):
            raise ValueError("Missing required arguments: either page_id or both title and space_key")
            
        # Fetch the page content
        page_data = None
        if page_id:
            page_data = await confluence_client.get_page(page_id, expand="body.storage,version,space")
        else:
            # Search by title and space key
            cql = f'title = "{title}" AND space.key = "{space_key}"'
            search_result = await confluence_client.search(cql, limit=1)
            if search_result.get("results"):
                page_id = search_result["results"][0]["id"]
                page_data = await confluence_client.get_page(page_id, expand="body.storage,version,space")
            else:
                raise ValueError("Page not found")
        
        page_title = page_data["title"]
        content = page_data["body"]["storage"]["value"]
        space_name = page_data.get("space", {}).get("name", "Unknown Space")
        
        # Convert content to markdown for better readability
        markdown_content = ConfluenceFormatter.confluence_to_markdown(content)
        
        # Extract context based on the context type
        if context_type == "summary":
            # Use first 1000 characters for summary context
            context = markdown_content[:1000] + "..." if len(markdown_content) > 1000 else markdown_content
        elif context_type == "details":
            context = markdown_content
        else:
            # For specific context, use full content but note it's not specifically filtered
            context = markdown_content
        
        # Create a response that answers the question based on the page content
        response = f"**Question:** {question}\n\n"
        response += f"**Page:** {page_title}\n"
        response += f"**Space:** {space_name}\n\n"
        response += f"**Answer based on page content:**\n\n"
        response += f"Here is the relevant content from the Confluence page to help answer your question:\n\n"
        response += f"**Context ({context_type}):**\n{context}\n\n"
        
        if context_type == "details":
            response += f"**Full Content:**\n{markdown_content}"
        else:
            response += f"Please note: This is a {context_type} view. For complete details, use context_type='details'."
        
        return [
            types.TextContent(
                type="text",
                text=response,
            )
        ]
Behavior2/5

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

No annotations are present, but the description does not disclose any behavioral traits such as read-only nature, authentication, or rate limits. It solely states the function.

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?

Single sentence, no fluff, but could benefit from a brief note on required parameter combinations.

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

Completeness2/5

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

With 5 parameters and no output schema, the description fails to explain return format, error conditions, or the effect of context_type choices.

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 coverage is 100%, so description adds little extra meaning beyond the schema. It underscores 'question' and context_type' but doesn't explain how they interact.

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 verb 'ask a question' and resource 'specific Confluence page content', distinguishing it from siblings like search-confluence or get-confluence-page.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus alternatives like get-confluence-page or search-confluence. Does not mention prerequisites or the need for either page_id or title+space_key.

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/akhilthomas236/mcp-jira-confluence-sse'

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