Skip to main content
Glama

cookItem

Cook items in Minecraft using a furnace by specifying the item name, fuel, and quantity. Part of the MCP server’s features for automating in-game tasks.

Instructions

Cook an item in a furnace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesNumber of items to cook
fuelNameYesThe fuel to use for cooking
itemNameYesThe name of the item to cook

Implementation Reference

  • The primary handler function implementing the cookItem tool. It validates input parameters (itemName, fuelName), sets default count, and delegates to useFurnace helper with action 'cook' to perform the cooking.
    export const cookItem = async ( bot: Bot, params: ISkillParams, serviceParams: ISkillServiceParams, ): Promise<boolean> => { const skillName = 'cookItem'; const requiredParams = ['itemName', 'fuelName']; const isParamsValid = validateSkillParams( params, requiredParams, skillName, ); if (!isParamsValid) { serviceParams.cancelExecution?.(); bot.emit( 'alteraBotEndObservation', `Mistake: You didn't provide all of the required parameters ${requiredParams.join(', ')} for the ${skillName} skill.`, ); return false; } const defaultParams = { count: 1, }; const useCount: number = Math.min(defaultParams.count, 4); return await useFurnace(bot, { itemName: params.itemName, fuelName: params.fuelName, count: useCount, action: 'cook', signal: serviceParams.signal, getStatsData: serviceParams.getStatsData, setStatsData: serviceParams.setStatsData, }); };
  • Schema metadata for cookItem tool defining input parameters (itemName, fuelName, count), descriptions, and required fields. Used to build the inputSchema for the SkillDefinition.
    cookItem: { description: "Cook an item in a furnace", params: { itemName: { type: "string", description: "The name of the item to cook" }, fuelName: { type: "string", description: "The fuel to use for cooking" }, count: { type: "number", description: "Number of items to cook" } }, required: ["itemName", "fuelName", "count"] },
  • Registration code within loadSkills() that iterates over SKILL_METADATA (including cookItem), creates SkillDefinition with schema and dynamic executor loader, and collects them for use in the MCP server.
    for (const [skillName, metadata] of Object.entries(SKILL_METADATA)) { skills.push({ name: skillName, description: metadata.description, inputSchema: { type: "object", properties: metadata.params, required: metadata.required }, execute: createSkillExecutor(skillName) }); }

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/leo4life2/minecraft-mcp-http'

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