Skip to main content
Glama
tHeMaskedMan981

Network School Events MCP Server

search_wiki

Find information about visas, internet access, food options, getting started guides, and other essential resources for Network School students.

Instructions

Search the Network School wiki for information about visas, internet, food, getting started, and more

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query (e.g., "wifi password", "visa", "breakfast", "sim card")

Implementation Reference

  • Core handler function that implements the search_wiki tool logic: reads all .md files in the wiki directory, counts case-insensitive matches of the query, collects results from matching pages, sorts by match count descending, and returns array of {page, content, matches}.
    export async function searchWiki(query: string): Promise<{ page: string; content: string; matches: number }[]> {
      const wikiDir = getWikiDir();
      const lowerQuery = query.toLowerCase();
      
      try {
        const files = await readdir(wikiDir);
        const mdFiles = files.filter(f => f.endsWith('.md'));
        
        const results: { page: string; content: string; matches: number }[] = [];
        
        for (const file of mdFiles) {
          const filePath = join(wikiDir, file);
          const content = await readFile(filePath, 'utf-8');
          const lowerContent = content.toLowerCase();
          
          // Count matches
          const matches = (lowerContent.match(new RegExp(lowerQuery, 'g')) || []).length;
          
          if (matches > 0) {
            const pageName = file.replace('.md', '');
            results.push({
              page: pageName,
              content,
              matches,
            });
          }
        }
        
        // Sort by number of matches (descending)
        results.sort((a, b) => b.matches - a.matches);
        
        return results;
      } catch (error) {
        console.error('Error searching wiki:', error);
        return [];
      }
    }
  • src/index.ts:113-126 (registration)
    Tool registration in the list_tools MCP handler, defining name 'search_wiki', description, and input schema requiring a 'query' string.
    {
      name: 'search_wiki',
      description: 'Search the Network School wiki for information about visas, internet, food, getting started, and more',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query (e.g., "wifi password", "visa", "breakfast", "sim card")',
          },
        },
        required: ['query'],
      },
    },
  • Input schema for search_wiki tool: object with required 'query' string property.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query (e.g., "wifi password", "visa", "breakfast", "sim card")',
        },
      },
      required: ['query'],
    },
  • Dispatch handler in call_tool MCP request: validates query arg, invokes searchWiki, formats results into a markdown response with titles and contents separated by ---, or error/no-results messages.
    case 'search_wiki': {
      const query = args?.query as string;
      
      if (!query || typeof query !== 'string') {
        return {
          content: [
            {
              type: 'text',
              text: 'Error: query parameter is required and must be a string',
            },
          ],
          isError: true,
        };
      }
    
      const results = await searchWiki(query);
      
      if (results.length === 0) {
        return {
          content: [
            {
              type: 'text',
              text: `No wiki pages found matching "${query}".`,
            },
          ],
        };
      }
    
      // Format the results
      let response = `Found ${results.length} wiki page${results.length !== 1 ? 's' : ''} matching "${query}":\n\n`;
      
      results.forEach((result, index) => {
        const title = result.page
          .split('-')
          .map(word => word.charAt(0).toUpperCase() + word.slice(1))
          .join(' ');
        
        response += `**${index + 1}. ${title}** (${result.matches} match${result.matches !== 1 ? 'es' : ''})\n\n`;
        response += result.content;
        response += '\n\n---\n\n';
      });
    
      return {
        content: [
          {
            type: 'text',
            text: response.trim(),
          },
        ],
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action 'search' but doesn't describe how results are returned (e.g., format, pagination), potential limitations (e.g., rate limits, authentication needs), or what happens on errors. The description adds minimal behavioral context beyond the basic action.

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 a single, efficient sentence that front-loads the core action and resource. It could be slightly more structured by explicitly listing use cases, but it avoids redundancy and wastes no words, making it appropriately concise for a simple search tool.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no annotations, no output schema), the description is minimally adequate. It covers the purpose and scope but lacks details on behavioral traits, usage guidelines, and output format. Without annotations or output schema, more context on results and limitations would improve completeness for agent invocation.

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%, with the single parameter 'query' well-documented in the schema (including examples like 'wifi password'). The description adds no additional parameter semantics beyond what the schema provides, such as query syntax or result relevance. Baseline 3 is appropriate given high schema coverage.

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 verb 'search' and the resource 'Network School wiki', specifying the content scope (visas, internet, food, getting started, and more). However, it doesn't explicitly differentiate from sibling tools like search_events, which searches events rather than wiki content, though this distinction is implied by the resource type.

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. It mentions the types of information available (visas, internet, etc.) but doesn't specify prerequisites, exclusions, or compare it to sibling tools like search_events for event-related queries. Usage is implied by the content scope but not explicitly stated.

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/tHeMaskedMan981/ns-mcp'

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