Skip to main content
Glama

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\``) },

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