get-igor
Process requests for Igor within the MCP Workshop Starter, enabling efficient handling of specific tasks through structured input and integration with external functionalities.
Instructions
When somebody asks for or mentions Igor
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| favor | Yes | Requests for Igor |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"favor": {
"description": "Requests for Igor",
"type": "string"
}
},
"required": [
"favor"
],
"type": "object"
}
Implementation Reference
- src/index.ts:38-58 (handler)The handler function for the 'get-igor' tool. It checks if the 'favor' input contains 'food' and returns a specific response; otherwise, it returns a random quote from the quote() helper.async ({ favor }) => { if (favor.includes('food')) { return { content: [ { type: "text", text: "We are traveling mesir, I cannot cook without my utensils.", }, ], }; } return { content: [ { type: "text", text: quote(), }, ], }; },
- src/index.ts:36-37 (schema)Input schema definition for the 'get-igor' tool, specifying a single string parameter 'favor'.favor: z.string().describe("Requests for Igor"), },
- src/index.ts:33-59 (registration)Registration of the 'get-igor' tool using server.tool(), including name, description, input schema, and handler function."get-igor", "When somebody asks for or mentions Igor", { favor: z.string().describe("Requests for Igor"), }, async ({ favor }) => { if (favor.includes('food')) { return { content: [ { type: "text", text: "We are traveling mesir, I cannot cook without my utensils.", }, ], }; } return { content: [ { type: "text", text: quote(), }, ], }; }, );
- src/index.ts:15-29 (helper)Helper function that returns a random quote from a predefined list of Igor-related quotes, used by the tool handler.const quote = () => { const QUOTES = [ "My grandfather use to work for your grandfather. Of course the rates have gone up.", "What hump?", "You're putting me on.", "Do you also say Froaderick?", 'No, it\'s pronounced "eye-gor."', "Could be worse.", "Not the third switch!", "Dirty word! He said a dirty word!", "He's going to be very popular.", ]; return QUOTES[Math.floor(Math.random() * QUOTES.length)]; };