GnistAI GnistAI
Log in

Getting Started with Recipe Database

International recipe collection — search by name, browse by category or cuisine, get random recipes.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Food & Drink

Data source: TheMealDB

Overview

Recipe Database wraps TheMealDB, handling authentication, pagination, and rate limits for you. This tutorial covers all 7 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-recipe": {
      "url": "https://context.gnist.ai/mcp/recipe/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (7)

search_recipes

Search international recipes by name. Returns full recipe details including ingredients, instructions, and category. Args: query: Recipe name to search for (e.g. "Arrabiata", "chicken", "pasta").

ParameterTypeRequiredDescription
querystringrequiredRecipe name to search for (e.g. "Arrabiata", "chicken", "pasta").
curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_recipes", "arguments": {"query": "Arrabiata"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'query': 'Arrabiata'}, 'name': 'search_recipes'}},
)
print(resp.json())

get_recipe

Get full details for a specific recipe by its ID. Args: meal_id: TheMealDB recipe ID (e.g. "52771"). Returns: Full recipe record with ingredients, instructions, category, and cuisine.

ParameterTypeRequiredDescription
meal_idstringrequiredTheMealDB recipe ID (e.g. "52771").
curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_recipe", "arguments": {"meal_id": "52771"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'meal_id': '52771'}, 'name': 'get_recipe'}},
)
print(resp.json())

get_random_recipe

Get a random recipe from the international recipe database. Returns: A randomly selected recipe with full details.

curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_random_recipe", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'get_random_recipe'}},
)
print(resp.json())

list_categories

List all available recipe categories (e.g. Beef, Chicken, Dessert, Seafood). Returns: List of categories with names, thumbnails, and descriptions.

curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "list_categories", "arguments": {}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {}, 'name': 'list_categories'}},
)
print(resp.json())

filter_by_category

Filter recipes by category. Returns recipe summaries (name, ID, image). Use get_recipe() with the returned ID to get full details. Args: category: Recipe category (e.g. "Beef", "Chicken", "Dessert", "Seafood", "Vegetarian").

ParameterTypeRequiredDescription
categorystringrequiredRecipe category (e.g. "Beef", "Chicken", "Dessert", "Seafood", "Vegetarian").
curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "filter_by_category", "arguments": {"category": "Beef"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'category': 'Beef'}, 'name': 'filter_by_category'}},
)
print(resp.json())

filter_by_area

Filter recipes by cuisine/area. Returns recipe summaries (name, ID, image). Use get_recipe() with the returned ID to get full details. Args: area: Cuisine area (e.g. "Italian", "Japanese", "Mexican", "British", "Indian").

ParameterTypeRequiredDescription
areastringrequiredCuisine area (e.g. "Italian", "Japanese", "Mexican", "British", "Indian").
curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "filter_by_area", "arguments": {"area": "Italian"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'area': 'Italian'}, 'name': 'filter_by_area'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/recipe/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/recipe/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_recipes to find items, then get_recipe to get full details. This two-step pattern is common for exploring data before drilling down.

FAQ

What data does Recipe Database provide?

International recipe collection — search by name, browse by category or cuisine, get random recipes. It exposes 7 tools: search_recipes, get_recipe, get_random_recipe, list_categories, filter_by_category, filter_by_area, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the Recipe Database API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials