Skip to main content
Glama
vitaliiivanovspryker

Spryker Package Search Tool

search_spryker_packages

Search Spryker packages and modules in GitHub repositories using natural language queries to find relevant code and documentation.

Instructions

To search the Spryker package repository in Github

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe natural language query to search in Github
organisationsNoOptional array of organisations to filter by [`spryker`, `spryker-eco`, `spryker-sdk`, `spryker-shop`

Implementation Reference

  • The handler function that executes the tool logic: normalizes query, validates organisations, builds GitHub search query, performs repository search, formats and returns results as text content.
    export const searchSprykerPackages = async ({query, organisations}) => {
        logger.info(`Received searchSprykerPackages request`, { query, organisations });
    
        try {
            const normalizedQuery = normalizeQuery(query);
    
            const validatedOrgs = validateOrganisations(organisations);
            logger.info(`Using organizations for searchSprykerPackages`, { organisations: validatedOrgs });
    
            const githubQuery = buildGitHubQuery(normalizedQuery, validatedOrgs);
    
            logger.info(`Performing GitHub repository searchSprykerPackages`, { query: githubQuery });
    
            const searchResults = await searchGitHubRepositories(githubQuery);
    
            logger.info(`GitHub searchSprykerPackages completed`, {
                resultCount: searchResults.items ? searchResults.items.length : 0,
                totalCount: searchResults.total_count
            });
    
            const formattedText = formatResults(searchResults.items, validatedOrgs);
            logger.debug(`Search results formatted for display`);
    
            return {
                content: [{
                    type: `text`,
                    text: formattedText
                }]
            };
        } catch (error) {
            logger.error(`Error in search: ${error.message}`, {
                error,
                stack: error.stack
            });
    
            return {
                content: [{
                    type: `text`,
                    text: `Error performing search: ${error.message}`
                }]
            };
        }
    }
  • src/index.js:38-53 (registration)
    Registers the 'search_spryker_packages' tool with the MCP server, specifying name, description, input parameters, and the handler function.
    server.tool(
        `search_spryker_packages`,
        `To search the Spryker package repository in Github`,
        {
            query: z
                .string()
                .max(120)
                .min(5)
                .describe(`The natural language query to search in Github`),
            organisations: z
                .array(z.string())
                .optional()
                .describe(`Optional array of organisations to filter by [\`spryker\`, \`spryker-eco\`, \`spryker-sdk\`, \`spryker-shop\``)
        },
        searchSprykerPackages
    );
  • Input schema definition using Zod: 'query' as string (min 5, max 120 chars), optional 'organisations' as array of strings with predefined options.
    {
        query: z
            .string()
            .max(120)
            .min(5)
            .describe(`The natural language query to search in Github`),
        organisations: z
            .array(z.string())
            .optional()
            .describe(`Optional array of organisations to filter by [\`spryker\`, \`spryker-eco\`, \`spryker-sdk\`, \`spryker-shop\``)
    },
  • Helper function to format the GitHub repository search results into readable text, specific to searchSprykerPackages.
    export const formatResults = (repositories, organisations) => {
        if (!repositories || repositories.length === 0) {
            return `No repositories found matching your searchSprykerPackages criteria.`;
        }
    
        let formattedText = `Found ${repositories.length} repositories:\n\n`;
    
        repositories.forEach((repo, index) => {
            formattedText += `${index + 1}. ${repo.name}\n`;
            formattedText += `   Description: ${repo.description || `No description available`}\n`;
            formattedText += `   URL: ${repo.html_url}\n\n`;
        });
    
        formattedText += `Search performed across organizations: ${organisations.join(`, `)}`;
    
        return formattedText;
    };
  • Helper function to construct the full GitHub search query by appending organization filters for searchSprykerPackages.
    export const buildGitHubQuery = (query, organisations) => {
        // Start with the base query
        let githubQuery = query;
    
        // Add organization filters
        if (organisations && organisations.length > 0) {
            const orgFilters = organisations.map(org => `org:${org}`).join(` `);
            githubQuery = `${githubQuery} ${orgFilters}`;
        }
    
        return githubQuery;
    };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.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 only states the purpose without disclosing behavioral traits such as read-only nature, rate limits, or authentication needs. The tool is essentially a black box.

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, well-formed sentence that front-loads the purpose. It is concise with zero wasted words.

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?

Despite having only 2 parameters with full schema coverage, the description lacks details about return format, error handling, or prerequisites. For a search tool with siblings, more context on scope and output would be helpful.

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 baseline is 3. The description does not add any additional parameter meaning beyond what the schema already provides.

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 'To search the Spryker package repository in Github' clearly states the verb (search) and resource (Spryker package repository), and it distinguishes from sibling tools that search code or documentation.

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 search_spryker_package_code or search_spryker_documentation. No when-not-to-use or context hints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.