Skip to main content
Glama

search_seqtypes

Query and retrieve animation sequence definitions from the seqtypes.txt file for Old School RuneScape. Use pagination to manage search results efficiently.

Instructions

Search the seqtypes.txt file for animation sequence definitions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
pageSizeNoNumber of results per page
queryYesThe term to search for in the file

Implementation Reference

  • Handler logic in the CallToolRequestHandler switch statement for 'search_seqtypes' (and other search_* tools). Parses input using FileSearchSchema, derives filename 'seqtypes.txt' from tool name, checks if file exists, calls searchFile helper, and returns paginated results.
    case "search_varptypes":
    case "search_varbittypes":
    case "search_iftypes":
    case "search_invtypes":
    case "search_loctypes":
    case "search_npctypes":
    case "search_objtypes":
    case "search_rowtypes":
    case "search_seqtypes":
    case "search_soundtypes":
    case "search_spottypes":
    case "search_spritetypes":
    case "search_tabletypes":
        const { query, page: filePage = 1, pageSize: filePageSize = 10 } = FileSearchSchema.parse(args);
        const filename = `${name.replace('search_', '')}.txt`;
        const filePath = path.join(DATA_DIR, filename);
        
        if (!fileExists(filename)) {
            return responseToString({ error: `${filename} not found in data directory` });
        }
        
        const fileResults = await searchFile(filePath, query, filePage, filePageSize);
        return responseToString(fileResults);
  • Input schema (FileSearchSchema) used by search_seqtypes and other search tools for validation and documentation.
    const FileSearchSchema = z.object({
        query: z.string().describe("The term to search for in the file"),
        page: z.number().int().min(1).optional().default(1).describe("Page number for pagination"),
        pageSize: z.number().int().min(1).max(100).optional().default(10).describe("Number of results per page")
    });
  • index.ts:298-302 (registration)
    Registration of the 'search_seqtypes' tool in the ListToolsRequestHandler response.
    {
        name: "search_seqtypes",
        description: "Search the seqtypes.txt file for animation sequence definitions.",
        inputSchema: convertZodToJsonSchema(FileSearchSchema),
    },
  • Core searchFile helper function that performs case-insensitive line search in the specified file (seqtypes.txt for this tool), applies pagination, formats results as ID-value pairs, and returns structured results with pagination info.
    async function searchFile(filePath: string, searchTerm: string, page: number = 1, pageSize: number = 10): Promise<any> {
        //replace spaces with underscores
        searchTerm = searchTerm.replace(" ", "_");
        return new Promise((resolve, reject) => {
            if (!fs.existsSync(filePath)) {
                reject(new Error(`File not found: ${filePath}`));
                return;
            }
    
            const results: {line: string, lineNumber: number}[] = [];
            const fileStream = fs.createReadStream(filePath);
            const rl = readline.createInterface({
                input: fileStream,
                crlfDelay: Infinity
            });
    
            let lineNumber = 0;
            
            rl.on('line', (line) => {
                lineNumber++;
                if (line.toLowerCase().includes(searchTerm.toLowerCase())) {
                    results.push({ line, lineNumber });
                }
            });
    
            rl.on('close', () => {
                const totalResults = results.length;
                const totalPages = Math.ceil(totalResults / pageSize);
                const startIndex = (page - 1) * pageSize;
                const endIndex = startIndex + pageSize;
                const paginatedResults = results.slice(startIndex, endIndex);
    
                // Process the results to extract key-value pairs if possible
                const formattedResults = paginatedResults.map(result => {
                    // Try to format as key-value pair (common for ID data files)
                    const parts = result.line.split(/\s+/);
                    if (parts.length >= 2) {
                        const id = parts[0];
                        const value = parts.slice(1).join(' ');
                        return {
                            ...result,
                            id,
                            value,
                            formatted: `${id}\t${value}`
                        };
                    }
                    return result;
                });
    
                resolve({
                    results: formattedResults,
                    pagination: {
                        page,
                        pageSize,
                        totalResults,
                        totalPages,
                        hasNextPage: page < totalPages,
                        hasPreviousPage: page > 1
                    }
                });
            });
    
            rl.on('error', (err) => {
                reject(err);
            });
        });
    }
  • fileExists helper function used to check if the data file (e.g., seqtypes.txt) exists before searching.
    function fileExists(filename: string): boolean {
        const filePath = path.join(DATA_DIR, filename);
        return fs.existsSync(filePath);
    }
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. The description mentions searching a file but doesn't disclose important behavioral traits such as whether this is a read-only operation, what happens with invalid queries, whether results are cached, or any rate limits. For a search tool with zero annotation coverage, this is a significant gap.

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 directly states the tool's purpose without any wasted words. It's appropriately sized and front-loaded, making it easy to understand at a glance.

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 the complexity of a search operation with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the search returns, how results are structured, or any behavioral constraints. For a tool with no structured metadata beyond the input schema, the description should provide more context about the operation.

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 all three parameters (query, page, pageSize). The description adds no additional meaning beyond what the schema provides—it doesn't explain parameter interactions, search semantics, or result formatting. The baseline of 3 is appropriate when the schema does all 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') and the target resource ('seqtypes.txt file for animation sequence definitions'), which provides specific verb+resource pairing. However, it doesn't distinguish this tool from its many sibling search tools (e.g., search_iftypes, search_invtypes, etc.) beyond specifying the file name, which is adequate but not fully differentiated.

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. With many sibling search tools available (e.g., search_data_file, search_iftypes), there's no indication of what makes this tool unique or when it should be preferred over others. The description only states what it does, not when to use it.

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/JayArrowz/mcp-osrs'

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