Skip to main content
Glama
KS-GEN-AI

Confluence Communication Server

execute_cql_search

Search Confluence pages using CQL queries to find specific content and retrieve results for information access.

Instructions

Execute a CQL query on Confluence to search pages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cqlYesCQL query string
limitNoNumber of results to return

Implementation Reference

  • src/index.ts:40-58 (registration)
    Registration of the 'execute_cql_search' tool in the listTools handler, including name, description, and input schema.
    {
      name: 'execute_cql_search',
      description: 'Execute a CQL query on Confluence to search pages',
      inputSchema: {
        type: 'object',
        properties: {
          cql: {
            type: 'string',
            description: 'CQL query string',
          },
          limit: {
            type: 'integer',
            description: 'Number of results to return',
            default: 10,
          },
        },
        required: ['cql'],
      },
    },
  • Input schema definition for the 'execute_cql_search' tool, specifying CQL query and optional limit.
    inputSchema: {
      type: 'object',
      properties: {
        cql: {
          type: 'string',
          description: 'CQL query string',
        },
        limit: {
          type: 'integer',
          description: 'Number of results to return',
          default: 10,
        },
      },
      required: ['cql'],
    },
  • MCP tool call handler for 'execute_cql_search': extracts parameters, validates, calls executeCQL, and formats response.
    case 'execute_cql_search': {
      const cql = String(request.params.arguments?.cql);
      const limit = Number(request.params.arguments?.limit ?? 10);
    
      if (!cql) {
        throw new Error('CQL query is required');
      }
    
      const response = await executeCQL(cql, limit);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(response, null, 2),
          },
        ],
      };
    }
  • Core handler function that executes the CQL search via Axios GET to Confluence API, handles errors.
    async function executeCQL(cql: string, limit: number): Promise<any> {
      try {
        const params = {
          cql,
          limit,
        };
    
        const response = await axios.get(
          `${CONFLUENCE_URL}/wiki/rest/api/content/search`,
          {
            // Updated URL
            headers: getAuthHeaders().headers,
            params,
          },
        );
    
        return response.data;
      } catch (error: any) {
        return {
          error: error.response ? error.response.data : error.message,
        };
      }
    }
  • Helper function to generate authentication headers using Confluence API credentials, used in executeCQL.
    function getAuthHeaders(): AxiosRequestConfig<any> {
      const authHeader = `Basic ${Buffer.from(
        `${CONFLUENCE_API_MAIL}:${CONFLUENCE_API_KEY}`,
      ).toString('base64')}`;
      return {
        headers: {
          Authorization: authHeader,
          'Content-Type': 'application/json',
        },
      };
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the tool executes a CQL query, it doesn't describe what happens during execution - whether it's read-only, what permissions are required, how results are structured, whether there are rate limits, or what errors might occur. For a search tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

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 a single, efficient sentence that states the core functionality without any wasted words. It's appropriately sized for a search tool and front-loads the essential information. Every word earns its place in conveying the tool's purpose.

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?

Given that this is a search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (search results format), what happens on execution, or provide any context about CQL query capabilities. For a tool that executes queries against a complex system like Confluence, more context about behavior and results is needed.

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 fully documents both parameters (cql query string and limit with default). The description adds no additional parameter information beyond what's in the schema - it doesn't explain CQL syntax, provide query examples, or clarify the limit parameter's behavior. The baseline 3 is appropriate when the schema does all the parameter documentation work.

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 action ('Execute a CQL query') and target resource ('on Confluence to search pages'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like get_page_content or update_page_content, which appear to be different operations rather than alternative search methods.

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?

The description provides no guidance about when to use this tool versus alternatives. There's no mention of when this search method is appropriate, what types of queries it supports, or how it differs from other search approaches. The sibling tools appear to be for different purposes (getting/updating content rather than searching), but this distinction isn't explained.

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/KS-GEN-AI/confluence-mcp-server'

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