server¶
Explicit headed-browser search¶
HTTP remains the default. To use a real browser instead, install the optional extra and its Chromium binary on the MCP server machine:
uv sync --extra browser
uv run --extra browser playwright install chromium
uv run --extra browser gurume mcp
Call tabelog_search_restaurants with:
{"area": "三重", "sort": "ranking", "limit": 10, "transport": "browser"}
This opens headed Chromium and fetches one page using the same URL builder,
restaurant parser, metadata, and area/cuisine checks as HTTP search. After a navigation
timeout, it can recover rendered content only when the current main-frame HTTP
response status is known and the document passes validation. It does not navigate
again. Empty output requires explicit not-found markup, the shared parser's
該当のエリア・駅が見つかりませんでした area-error text, or a parsed zero count;
positive/unknown counts with no parsed restaurants are errors. A graphical
display is required. CLI and TUI continue to use HTTP; Python callers can explicitly
use await SearchRequest(...).search_browser().
The dedicated profile is ~/.cache/gurume/browser. Cookies stay within that profile;
they are not copied from other browsers or sent to the HTTP client. Access is not
guaranteed: verification pages return a non-retryable error, not empty results.
Transient HTTP 5xx, navigation timeouts, and recognized network failures return
retryable: true with a retry-later action. Verification/403, other HTTP 4xx,
installation/display/profile errors, and unrecognized documents remain
non-retryable. Permanent HTTP 4xx errors report their status and recommend checking
the generated URL/upstream routes (or rate limits for 429), rather than browser
installation or verification. This metadata allows callers to decide whether to retry; the tool
itself performs no automatic fallback, challenge solving, or retry.
If verification is required, manually open the same profile on the server machine:
uv run --extra browser playwright open --browser chromium \
--user-data-dir "$HOME/.cache/gurume/browser" \
'https://tabelog.com/mie/rstLst/?SrtT=rt&PG=1'
Complete any verification yourself, then close that browser before calling the tool again. Concurrent calls sharing the profile are not supported. The tool closes its browser on success, failure, or cancellation and does not leave a verification window running. Do not repeatedly call it if access remains denied.
gurume.server ¶
MCP Server for Tabelog restaurant search using FastMCP.
This module keeps the FastMCP instance and tool entrypoints together while delegating response schemas and helper logic to focused modules.
CourseOutput ¶
Bases: BaseModel
Structured course output.
CuisineListOutput ¶
Bases: BaseModel
Structured cuisine list output for MCP clients.
CuisineOutput ¶
Bases: BaseModel
Cuisine type output schema.
MenuItemOutput ¶
Bases: BaseModel
Structured menu item output.
RestaurantDetailOutput ¶
Bases: BaseModel
Structured restaurant detail output for MCP clients.
RestaurantOutput ¶
Bases: BaseModel
Restaurant search result output schema.
RestaurantSearchOutput ¶
Bases: BaseModel
Structured restaurant search output for MCP clients.
ReviewOutput ¶
Bases: BaseModel
Structured restaurant review output.
SearchFiltersOutput ¶
Bases: BaseModel
Normalized filters used for a search request.
SearchMetaOutput ¶
Bases: BaseModel
Pagination and result metadata for restaurant search.
SuggestionListOutput ¶
Bases: BaseModel
Structured suggestion list output for MCP clients.
SuggestionOutput ¶
Bases: BaseModel
Area or keyword suggestion output schema.
ToolErrorOutput ¶
Bases: BaseModel
Structured MCP tool error output for agent-friendly recovery.
run ¶
run(
transport: TransportType = "stdio",
host: str = "127.0.0.1",
port: int = 8000,
path: str = "/mcp",
) -> None
Synchronous entry point for CLI
This function is called when running 'gurume mcp' command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transport
|
TransportType
|
MCP transport to use ("stdio", "sse", or "streamable-http"). |
'stdio'
|
host
|
str
|
Bind host for HTTP transports (ignored for stdio). |
'127.0.0.1'
|
port
|
int
|
Bind port for HTTP transports (ignored for stdio). |
8000
|
path
|
str
|
HTTP mount path for the MCP endpoint (streamable-http uses
|
'/mcp'
|
Source code in src/gurume/server.py
684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 | |
tabelog_get_area_suggestions
async
¶
tabelog_get_area_suggestions(
query: Annotated[
str,
Field(
description="Area query in Japanese, hiragana, or romaji. Use this before searching when area names are ambiguous.",
min_length=1,
),
],
) -> SuggestionListOutput
Get area and station suggestions for validating user-provided locations.
Source code in src/gurume/server.py
526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | |
tabelog_get_keyword_suggestions
async
¶
tabelog_get_keyword_suggestions(
query: Annotated[
str,
Field(
description="Keyword query in Japanese, hiragana, or romaji. Use this to detect Genre2 cuisines or restaurant-name suggestions before searching.",
min_length=1,
),
],
) -> SuggestionListOutput
Get keyword suggestions for cuisine names, restaurant names, and popular search variants.
Source code in src/gurume/server.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 | |
tabelog_get_restaurant_details
async
¶
tabelog_get_restaurant_details(
restaurant_url: Annotated[
str,
Field(
description="Tabelog restaurant URL from search results. Must start with https://tabelog.com/.",
pattern="^https://tabelog\\.com/.+",
),
],
fetch_reviews: Annotated[
bool,
Field(
default=True,
description="Whether to fetch review pages from Tabelog after the base page.",
),
] = True,
fetch_menu: Annotated[
bool,
Field(
default=True,
description="Whether to fetch the restaurant menu page after the base page.",
),
] = True,
fetch_courses: Annotated[
bool,
Field(
default=True,
description="Whether to fetch the restaurant course page after the base page.",
),
] = True,
max_review_pages: Annotated[
int,
Field(
default=1,
description="Maximum number of review pages to fetch when fetch_reviews is true.",
ge=1,
),
] = 1,
) -> RestaurantDetailOutput
Fetch base restaurant information and optional reviews, menu items, and courses.
Source code in src/gurume/server.py
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | |
tabelog_list_cuisines
async
¶
tabelog_list_cuisines() -> CuisineListOutput
Get the complete list of all 29 supported Japanese cuisine types with their Tabelog genre codes.
WHEN TO USE:
- Before calling tabelog_search_restaurants with cuisine parameter to verify available options
- Providing cuisine type suggestions/autocomplete to users
- Validating user's cuisine input against supported types
- Building UI dropdown menus or selection lists
RETURN FORMAT: Returns list of all supported cuisines: - name: Cuisine name in Japanese (e.g., 'すき焼き', '焼肉', 'ラーメン') - code: Tabelog genre code (e.g., 'RC0107', 'RC0103') - used internally for filtering
CUISINE CATEGORIES (29 types total): - Japanese: すき焼き, しゃぶしゃぶ, 寿司, 天ぷら, とんかつ, 焼き鳥, ラーメン, うどん, そば, うなぎ, 日本料理, 海鮮 - Hotpot/Nabe: 鍋, もつ鍋 - Izakaya: 居酒屋 - Western: フレンチ, イタリアン, ステーキ, ハンバーグ, ハンバーガー, 洋食 - Chinese: 中華料理, 餃子 - Yakiniku: 焼肉, ホルモン - Other: カレー, カフェ, パン, スイーツ
WORKFLOW EXAMPLE:
1. User asks: 'Find sukiyaki restaurants in Tokyo'
2. Call tabelog_list_cuisines to verify 'すき焼き' is supported → Returns {name: 'すき焼き', code: 'RC0107'}
3. Call tabelog_search_restaurants with area='東京', cuisine='すき焼き'
NO INPUT REQUIRED: This tool takes no parameters, simply call it to get the full list.
Returns:
| Type | Description |
|---|---|
CuisineListOutput
|
List of all supported cuisine types with their genre codes |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If cuisine list retrieval fails (should be rare as data is static) |
Source code in src/gurume/server.py
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 | |
tabelog_search_map_restaurants
async
¶
tabelog_search_map_restaurants(
min_lat: Annotated[
float,
Field(
strict=True,
ge=-90,
le=90,
description="Southern latitude of the search rectangle",
),
],
max_lat: Annotated[
float,
Field(
strict=True,
ge=-90,
le=90,
description="Northern latitude of the search rectangle",
),
],
min_lon: Annotated[
float,
Field(
strict=True,
ge=-180,
le=180,
description="Western longitude of the search rectangle",
),
],
max_lon: Annotated[
float,
Field(
strict=True,
ge=-180,
le=180,
description="Eastern longitude of the search rectangle",
),
],
cuisine: Annotated[
str,
Field(
description="Only 焼き鳥 is currently verified for the map endpoint"
),
] = "焼き鳥",
page: Annotated[
int,
Field(
strict=True,
ge=1,
description="Upstream page; fixed 20 markers per page",
),
] = 1,
limit: Annotated[
int,
Field(
strict=True,
ge=1,
le=20,
description="Results to return from the fetched page",
),
] = 20,
) -> MapSearchOutput
Search yakitori by geographic rectangle using undocumented map XML, NOT a prefecture/national ranking.
Sorting is by upstream rating. Bounds may cross prefectures; total_count is the rectangle total. Budget fields are raw and unverified. This is separate from tabelog_search_restaurants, not a 403 fallback.
Source code in src/gurume/server.py
649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 | |
tabelog_search_restaurants
async
¶
tabelog_search_restaurants(
area: Annotated[
str | None,
Field(
default=None,
description="Area name in Japanese. Prefer a validated prefecture, city, or station from `tabelog_get_area_suggestions`.",
min_length=1,
),
] = None,
keyword: Annotated[
str | None,
Field(
default=None,
description="General keyword for restaurant names or free-text matching. Use `cuisine` for cuisine-type searches.",
min_length=1,
),
] = None,
cuisine: Annotated[
str | None,
Field(
default=None,
description="Cuisine name in Japanese. Validate with `tabelog_get_keyword_suggestions` or `tabelog_list_cuisines` before searching.",
min_length=1,
),
] = None,
sort: Annotated[
SortOption,
Field(
default="ranking",
description="Result ordering: ranking, review-count, new-open, or standard.",
),
] = "ranking",
limit: Annotated[
int,
Field(
default=20,
description="Maximum number of restaurants to return from the first fetched page.",
ge=1,
le=60,
),
] = 20,
page: Annotated[
int,
Field(
default=1,
description="1-based result page to fetch from Tabelog. Use the returned metadata to continue paging.",
ge=1,
),
] = 1,
reservation_date: Annotated[
str | None,
Field(
default=None,
description="Reservation date in YYYYMMDD format. Must be used together with reservation_time.",
pattern="^\\d{8}$",
),
] = None,
reservation_time: Annotated[
str | None,
Field(
default=None,
description="Reservation time in 24-hour HHMM format. Must be used together with reservation_date.",
pattern="^\\d{4}$",
),
] = None,
party_size: Annotated[
int | None,
Field(
default=None,
description="Optional party size for reservation filtering.",
ge=1,
),
] = None,
transport: Annotated[
Literal["http", "browser"],
Field(
default="http",
description="Explicit transport: browser opens headed Chromium, not automatic fallback.",
),
] = "http",
) -> RestaurantSearchOutput
Search Tabelog restaurants with validated filters and pagination metadata.
Recommended workflow:
1. Validate ambiguous areas with tabelog_get_area_suggestions.
2. Validate cuisines or names with tabelog_get_keyword_suggestions.
3. Search using the normalized area and cuisine values.
4. Use page together with the returned meta.has_next_page and has_more fields to fetch later pages.
Returns a structured envelope with restaurants, applied filters, pagination metadata, and non-fatal warnings that help the caller refine follow-up tool calls.
Source code in src/gurume/server.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |