---
id: ListCategoriesGrpc
name: List categories over gRPC
version: 1.0.0
badges:
  - content: Catalog Management
    backgroundColor: green
    textColor: green
summary: Returns all Catalog categories through the book.v1 gRPC contract.
owners:
  - catalog-experience-team
schemaPath: schema.proto
sidebar:
  badge: "gRPC"
---

`ListCategoriesGrpc` invokes the internal `book.v1.BookGrpcService/ListCategories` gRPC unary RPC on [[service|catalog-api]] to return all registered book categories without pagination. [[service|mcp-server]] calls this RPC to power its `list_categories` tool.

## Overview

| Property                           | Value                                                                                    |
| :--------------------------------- | :--------------------------------------------------------------------------------------- |
| **Bounded Context**                | Catalog                                                                                  |
| **Owner Service**                  | [[service\|catalog-api]]                                                                 |
| **Protocol / Format**              | gRPC unary RPC (`book.v1.BookGrpcService/ListCategories`), Protobuf `edition = "2023"`   |
| **Gateway Endpoint**               | Internal gRPC RPC `book.v1.BookGrpcService/ListCategories` (not exposed via API Gateway) |
| **Authentication & Authorization** | Internal service-to-service anonymous read                                               |
| **Idempotency / Concurrency**      | Read-only and naturally idempotent                                                       |
| **Rate Limit / Caching**           | Backed by PostgreSQL and cached in L1 + Redis L2                                         |
| **Contract Version**               | `1.0.0`                                                                                  |

## Request & Response Contract

### Request Message (`ListCategoriesRequest`)

Empty Protobuf message with no fields.

### Success Response (`ListCategoriesResponse`)

| Name                | Type              | Required | Constraints                    | Description                                             |
| :------------------ | :---------------- | :------- | :----------------------------- | :------------------------------------------------------ |
| `categories`        | `CategoryItem[]`  | Yes      | Tag `1` (`repeated`)           | All catalog categories (empty collection if none exist) |
| `categories[].id`   | `string` (`uuid`) | Yes      | Tag `1`                        | Category UUID                                           |
| `categories[].name` | `string`          | Yes      | Tag `2` (empty string if null) | Category display name                                   |

## Behavior & Side Effects

- **Read-through caching:** Serves the category taxonomy from L1/Redis L2 cache, shared with [[query|ListCategories]].
- **No state mutation:** Pure read RPC with no database writes or integration events.

## Error Responses

| Status / Code        | Condition                  | Client Recovery Action                      |
| :------------------- | :------------------------- | :------------------------------------------ |
| `Unavailable` (`14`) | Catalog API is unreachable | Retry within the budgeted resilience policy |

## Related Documentation

- [[service|catalog-api]] — Service overview, persistence, and gRPC services.
- [[service|mcp-server]] — Primary caller exposing the `list_categories` MCP tool.
- [[entity|category]] — Category entity model.
- [[query|ListCategories]] — Public HTTP endpoint (`GET /catalog/api/v1/categories`).

<NodeGraph />

<SchemaViewer
	file="schema.proto"
	title="List categories over gRPC schema"
	maxHeight="500"
	search="true"
/>


 ## Raw Schema:schema.proto

edition = "2023";

package book.v1;

service BookGrpcService {
  rpc ListCategories (ListCategoriesRequest) returns (ListCategoriesResponse);
}

message ListCategoriesRequest {}

message ListCategoriesResponse {
  repeated CategoryItem categories = 1;
}

message CategoryItem {
  string id = 1;
  string name = 2;
}
