Skip to main content
Glama

search_pages

Retrieve WikiJS pages by entering a search query, optionally narrowing results by path or locale, enabling efficient content discovery and integration.

Instructions

Search for pages in WikiJS by query string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
localeNoOptional locale for the search (e.g., "en")
pathNoOptional path to limit search scope
queryYesSearch query to find pages

Implementation Reference

  • The createTool function returns the MCP tool handler for 'search_pages'. It extracts parameters from the request, calls wikiClient.searchPages, and returns the result as formatted JSON text content.
    export const createTool = (wikiClient: WikiJSClient): ToolCallback<typeof PARAMETERS> => {
    	return async (request) => {
    		const { query, path, locale } = request
    	
    		const result = await wikiClient.searchPages(query, path, locale);
    	
    		return {
    			content: [
    				{
    					type: 'text',
    					text: JSON.stringify(result, null, 2)
    				}
    			]
    		};
    	}
    }
  • Zod schema defining the input parameters for the search_pages tool: query (required string), path (optional string), locale (optional valid locale string).
    export const PARAMETERS = {
    	query: z.string().min(1, 'Query cannot be empty').describe('Search query to find pages'),
    	path: z.string().optional().describe('Optional path to limit search scope'),
    	locale: z.string().regex(/^[a-z]{2}(-[A-Z]{2})?$/, 'Invalid locale format').optional().describe('Optional locale for the search (e.g., "en")')
    };
  • src/mcp/index.ts:41-45 (registration)
    Registration of the 'search_pages' tool on the MCP server using server.tool, providing name, description, parameters schema, and the handler function from createSearchPagesTool.
    server.tool(
        'search_pages',
        'Search for pages in WikiJS by query string',
        SEARCH_PAGES_TOOL_PARAMETERS,
        createSearchPagesTool(this.wikiClient));
  • Helper method on WikiJSClient that performs the GraphQL search for pages using the SDK and handles fallback for empty results.
    async searchPages(query: string, path?: string, locale?: string) {
      const result = await this.sdk.SearchPages({ query, path, locale });
      return result.pages?.search || { results: [], suggestions: [], totalHits: 0 };
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool searches but doesn't disclose behavioral traits like whether it's read-only (implied but not stated), pagination, rate limits, authentication needs, or what happens with no results. For a search tool with zero annotation coverage, this is a significant gap in transparency.

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 with zero waste. It's front-loaded with the core purpose and appropriately sized for a search tool, making it easy to parse quickly.

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 no annotations, no output schema, and 3 parameters (with schema coverage but no behavioral context), the description is incomplete. It doesn't cover what the tool returns, error conditions, or how it differs from siblings. For a search tool in a WikiJS context, more guidance on usage 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 documents all three parameters (query, locale, path) with descriptions. The description adds minimal value beyond implying the query parameter is central ('by query string'), but doesn't explain parameter interactions or usage nuances. Baseline 3 is appropriate when schema does the heavy lifting.

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 ('Search for pages') and target resource ('in WikiJS'), with a specific mechanism ('by query string'). It distinguishes from siblings like get_all_pages (list all) and get_page_by_id/path (retrieve specific), though it doesn't explicitly name them. The purpose is specific but lacks explicit sibling differentiation.

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 on when to use this tool versus alternatives like get_all_pages (for listing all pages without filtering) or get_page_by_id/path (for retrieving known pages). It mentions 'by query string' which implies text-based searching, but offers no explicit when/when-not criteria or prerequisites.

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

Related 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/RicardoCenci/wikijs-mcp'

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