Skip to main content
Glama
IQAIcom
by IQAIcom

SEARCH_WIKI

Search IQ.wiki by query to find relevant wiki pages. Access the information you need directly.

Instructions

Search for a wiki from IQ.wiki by query

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe query to search for

Implementation Reference

  • The execute function that runs the SEARCH_WIKI tool logic — instantiates SearchWikiService, calls execute then format.
    	execute: async (params: SearchWikiParams) => {
    		try {
    			const service = new SearchWikiService();
    			const search = await service.execute(params.query);
    
    			return service.format(search);
    		} catch (error) {
    			if (error instanceof Error) {
    				console.log(`Error in SEARCH_WIKI tool: ${error.message}`);
    				return `Error searching for wiki: ${error.message}`;
    			}
    			return "An unknown error occurred while searching for wiki data";
    		}
    	},
    } as const;
  • SearchWikiService class with execute (makes GraphQL query) and format (formats search results into a string).
    import dedent from "dedent";
    import { client } from "../lib/graphql.js";
    import { SEARCH_WIKIS_QUERY } from "../lib/queries.js";
    
    export class SearchWikiService {
    	async execute(query: string) {
    		const response = await client.request(SEARCH_WIKIS_QUERY, { query });
    		return response.search;
    	}
    
    	format(search: Awaited<ReturnType<typeof this.execute>>) {
    		const formattedSearch = dedent`
    			📜 Search Results
    			- Answer: ${search.answer}
    			- Wiki Suggestions: ${(search.suggestions ?? [])
    				.map(
    					(suggestion: {
    						id: string;
    						title: string;
    					}) => `${suggestion.title} (${suggestion.id})`,
    				)
    				.join(", ")}
    		`;
    
    		return formattedSearch;
    	}
    }
  • Zod schema for the SEARCH_WIKI parameters: requires a 'query' string (min length 1).
    const searchWikiParams = z.object({
    	query: z.string().min(1).describe("The query to search for"),
    });
  • src/index.ts:7-21 (registration)
    Imports searchWikiTool and registers it via server.addTool(searchWikiTool) on line 21.
    import { searchWikiTool } from "./tools/search-wiki.js";
    
    async function main() {
    	console.log("Initializing IQ Wiki MCP Server...");
    
    	const server = new FastMCP({
    		name: "IQ Wiki MCP Server",
    		version: "0.0.1",
    	});
    
    	server.addTool(getWikiTool);
    	server.addTool(getUserCreatedWikisTool);
    	server.addTool(getUserEditedWikisTool);
    	server.addTool(getWikiActivitiesTool);
    	server.addTool(searchWikiTool);
  • GraphQL query definition (SEARCH_WIKIS_QUERY) that searches wikis with a query string and returns answer + suggestions.
    export const SEARCH_WIKIS_QUERY = graphql(`
      query searchWikis($query: String!) {
        search(query: $query) {
          answer
          suggestions {
            id
            title
          }
        }
      }
    `);
Behavior2/5

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

No annotations are provided, and the description does not disclose any behavioral traits such as output format, pagination, rate limits, or prerequisites. The bare description does not add value beyond the parameter schema.

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 very short and front-loaded with the purpose. Every word is necessary, though it could be slightly expanded without losing conciseness.

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?

For a search tool with no output schema and no annotations, the description is incomplete. It does not explain result format, limit, or how to interpret results, which is crucial for an agent to use the tool correctly.

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% and the parameter 'query' already has a description. The description does not add additional meaning beyond what the schema provides, so baseline is appropriate.

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 action (Search), resource (wiki from IQ.wiki), and method (by query). It distinguishes from sibling tools like GET_WIKI which likely retrieves a specific wiki.

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 vs alternatives like GET_WIKI or user-specific wikis. The description does not provide any context for usage.

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/IQAIcom/mcp-iqwiki'

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