Skip to main content
Glama
vitaliiivanovspryker

Spryker Package Search Tool

search_spryker_package_code

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

Instructions

To search code in Spryker GitHub repositories

Input Schema

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

Implementation Reference

  • The main handler function `searchSprykerCode` that performs the tool's core logic: query normalization, organization validation, GitHub code search query construction (with PHP filter), API call, result formatting, and response generation with error handling.
    export const searchSprykerCode = async ({query, organisations}) => {
        logger.info(`Received searchSprykerCode request`, { query, organisations });
    
        try {
            const normalizedQuery = normalizeQuery(query);
    
            const validatedOrgs = validateOrganisations(organisations);
            logger.info(`Using organizations for code search`, { organisations: validatedOrgs });
    
            const githubQuery = buildGitHubQuery(normalizedQuery, validatedOrgs) + ` in:file` + ` language:php`;
    
            logger.info(`Performing GitHub code search`, { query: githubQuery });
    
            const searchResults = await searchGitHubCode(githubQuery);
    
            logger.info(`GitHub code search completed`, {
                resultCount: searchResults.items ? searchResults.items.length : 0,
                totalCount: searchResults.total_count
            });
    
            const formattedText = formatCodeResults(searchResults.items, validatedOrgs);
            logger.debug(`Code search results formatted for display`);
    
            return {
                content: [{
                    type: `text`,
                    text: formattedText
                }]
            };
        } catch (error) {
            logger.error(`Error in code search: ${error.message}`, {
                error,
                stack: error.stack
            });
    
            return {
                content: [{
                    type: `text`,
                    text: `Error performing code search: ${error.message}`
                }]
            };
        }
    }
  • src/index.js:55-70 (registration)
    Registration of the `search_spryker_package_code` tool on the MCP server, including tool name, description, Zod input schema, and reference to the `searchSprykerCode` handler.
    server.tool(
        `search_spryker_package_code`,
        `To search code in Spryker GitHub repositories`,
        {
            query: z
                .string()
                .max(120)
                .min(5)
                .describe(`The natural language query to search in code of Spryker packages`),
            organisations: z
                .array(z.string())
                .optional()
                .describe(`Optional array of organisations to filter by [\`spryker\`, \`spryker-eco\`, \`spryker-sdk\`, \`spryker-shop\``)
        },
        searchSprykerCode
    );
  • Zod schema for tool inputs: `query` (required string 5-120 chars) and `organisations` (optional string array).
    {
        query: z
            .string()
            .max(120)
            .min(5)
            .describe(`The natural language query to search in code of Spryker packages`),
        organisations: z
            .array(z.string())
            .optional()
            .describe(`Optional array of organisations to filter by [\`spryker\`, \`spryker-eco\`, \`spryker-sdk\`, \`spryker-shop\``)
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't mention whether this is a read-only operation, what authentication might be required, rate limits, pagination behavior, or what format results are returned in. 'Search' implies querying, but no operational details are provided.

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 with zero wasted words. It's appropriately sized for a search tool and front-loads the essential information.

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 annotations and no output schema, the description is insufficiently complete. It doesn't explain what kind of results to expect (code snippets, file paths, repositories), how results are structured, or any limitations. The agent would need to guess about the tool's behavior and output format.

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 both parameters. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain query syntax, result ranking, or provide examples. 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 code') and target ('in Spryker GitHub repositories'), providing a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'search_spryker_packages' or 'search_spryker_documentation_path', which likely search different content types rather than code specifically.

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 doesn't mention sibling tools or clarify that this searches code specifically (as opposed to documentation or package metadata), leaving the agent to infer usage context from the tool name alone.

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/vitaliiivanovspryker/spryker-package-search-mcp'

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