Skip to main content
Glama
ErickWendel

Erick Wendel Contributions MCP

by ErickWendel

get_talks

Retrieve and filter Erick Wendel's talks by ID, title, language, location, or year, with options for pagination, grouping, and count-only queries.

Instructions

Get a list of talks with optional filtering and pagination.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cityNoFilter talks by city
count_onlyNoIf true, returns only the count without talk details
countryNoFilter talks by country
group_byNoGroup counts by a specific field (language, country, city)
idNoFilter talks by ID
languageNoFilter talks by language (e.g., 'spanish', 'english', 'portuguese' or direct codes like 'es', 'en', 'pt-br')
limitNoMaximum number of talks to return
skipNoNumber of talks to skip
titleNoFilter talks by title
yearNoFilter talks by year

Implementation Reference

  • The async handler function that implements the core logic of the 'get_talks' tool. It processes input parameters, calls the API service to fetch talks, handles special cases like year filtering, count-only mode, grouping, pagination, and formats the MCP text response.
    handler: async (params: TalksParams): Promise<McpResponse> => { try { const { id, title, language, city, country, year, skip, limit, count_only, group_by } = params; // Handle year-specific filtering if (year) { const allTalks = await fetchTalksByYear({ id, title, language, city, country, year }); if (count_only) { let response = `Total talks in ${year}: ${allTalks.length}`; if (group_by) { const counts = calculateGroupCounts(allTalks, group_by); response += formatGroupCounts(counts, group_by); } const content: McpTextContent = { type: "text", text: response }; return { content: [content], }; } // Apply pagination to filtered results const paginatedTalks = allTalks.slice(skip || 0, (skip || 0) + (limit || 10)); const content: McpTextContent = { type: "text", text: `Talks Results for ${year}:\n\n${JSON.stringify({ totalCount: allTalks.length, retrieved: paginatedTalks.length, talks: paginatedTalks }, null, 2)}` }; return { content: [content], }; } // Regular query without year filtering const result = await fetchTalks({ id, title, language, city, country, skip, limit, count_only }); if (!result.getTalks) { throw new Error('No results returned from API'); } if (count_only) { let response = `Total talks: ${result.getTalks.totalCount}`; if (group_by && result.getTalks.talks) { const counts = calculateGroupCounts(result.getTalks.talks, group_by); response += formatGroupCounts(counts, group_by); } const content: McpTextContent = { type: "text", text: response }; return { content: [content], }; } const content: McpTextContent = { type: "text", text: `Talks Results:\n\n${JSON.stringify(result.getTalks, null, 2)}` }; return { content: [content], }; } catch (error) { throw new Error(`Failed to fetch talks: ${error.message}`); } }
  • Zod schema defining the input parameters for the 'get_talks' tool, including filters, pagination, and grouping options.
    parameters: { id: z.string().optional().describe("Filter talks by ID"), title: z.string().optional().describe("Filter talks by title"), language: z.string().optional().describe("Filter talks by language (e.g., 'spanish', 'english', 'portuguese' or direct codes like 'es', 'en', 'pt-br')"), city: z.string().optional().describe("Filter talks by city"), country: z.string().optional().describe("Filter talks by country"), year: z.number().optional().describe("Filter talks by year"), skip: z.number().optional().default(0).describe("Number of talks to skip"), limit: z.number().optional().default(10).describe("Maximum number of talks to return"), count_only: z.boolean().optional().default(false).describe("If true, returns only the count without talk details"), group_by: z.string().optional().describe("Group counts by a specific field (language, country, city)"), },
  • src/index.ts:22-26 (registration)
    Registration of the 'get_talks' tool on the MCP server by calling server.tool() with its name, description, parameters, and handler.
    getTalksTool.name, getTalksTool.description, getTalksTool.parameters, getTalksTool.handler );
  • Configuration object providing the name and description for the 'get_talks' tool.
    talks: { name: "get_talks", description: "Get a list of talks with optional filtering and pagination." },
  • Helper function to calculate group counts by language, country, or city for talks, used in grouping feature.
    function calculateGroupCounts(talks: Talk[], groupBy: string): Map<string, number> { const counts = new Map<string, number>(); talks.forEach(talk => { if (!talk) return; let value = ''; switch(groupBy) { case 'language': value = talk.language || 'unknown'; break; case 'country': value = talk.location?.country || 'unknown'; break; case 'city': value = talk.location?.city || 'unknown'; break; default: return; } counts.set(value, (counts.get(value) || 0) + 1); }); return counts; }

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/ErickWendel/erickwendel-contributions-mcp'

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