Skip to content

Commit dbd06fe

Browse files
authored
feat(mcp)!: drop lookup_order tool from MCP surface (#42)
`GET /orders/lookup` is StatusPro's customer-verification path — requires `number` + `email` because email is the auth factor for unauthenticated customer self-service. With a Bearer-token MCP caller, the email requirement adds friction without security benefit. Removes the `lookup_order` MCP tool. `list_orders(search="…")` matches partial order number, name, or customer fields, which covers the operational lookup-by-number flow without needing customer email. The `Orders.lookup()` Python client helper is retained. Closes #35. BREAKING CHANGE: the `lookup_order` MCP tool no longer exists. Use `list_orders(search=…)` or `get_order(id=…)`.
1 parent f4c46b0 commit dbd06fe

3 files changed

Lines changed: 8 additions & 20 deletions

File tree

statuspro_mcp_server/src/statuspro_mcp/resources/help.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
1212
| Tool | Endpoint | Purpose |
1313
| ---- | -------- | ------- |
14-
| `list_orders` | `GET /orders` | Paginated list with filters (search, status, tags, due-date range). Auto-paginates. |
14+
| `list_orders` | `GET /orders` | Paginated list with filters (search, status, tags, due-date range). Auto-paginates. `search` matches order number, name, or customer fields — use it to find an order from just an order number. |
1515
| `get_order` | `GET /orders/{id}` | Full detail for one order, including history. |
16-
| `lookup_order` | `GET /orders/lookup` | Look up an order by `number` + customer `email`. |
1716
| `get_viable_statuses` | `GET /orders/{id}/viable-statuses` | Valid status transitions for the order's current state. |
1817
| `update_order_status` | `POST /orders/{id}/status` | Change status. Two-step confirm. |
1918
| `add_order_comment` | `POST /orders/{id}/comment` | Add a history comment. Two-step confirm. 5/min. |

statuspro_mcp_server/src/statuspro_mcp/server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def _build_auth() -> "AuthProvider | None":
189189
## Tool Selection Guide
190190
191191
**Finding orders:**
192-
list_orders (filter by status, date range, tags) | lookup_order (by order number + customer email) | get_order (by id)
192+
list_orders (filter by status, date range, tags; `search` matches order number, name, or customer fields) | get_order (by id)
193193
194194
**Changing status:**
195195
get_viable_statuses → update_order_status
@@ -223,7 +223,6 @@ def _build_auth() -> "AuthProvider | None":
223223
_READ_ONLY_TOOLS = [
224224
"list_orders",
225225
"get_order",
226-
"lookup_order",
227226
"list_statuses",
228227
"get_viable_statuses",
229228
]

statuspro_mcp_server/src/statuspro_mcp/tools/orders.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
"""MCP tools for StatusPro orders.
22
3-
7 tools mapping to the ``/orders*`` endpoints. Mutations use a two-step confirm
3+
6 tools mapping to the ``/orders*`` endpoints. Mutations use a two-step confirm
44
pattern: call with ``confirm=False`` to see a preview, then ``confirm=True`` to
55
execute (the client host elicits explicit user approval via ``ctx.elicit``).
66
77
Three tools — ``list_orders``, ``get_order``, ``update_order_status`` — return
88
a Prefab UI for MCP-Apps clients (Claude Desktop) via ``make_tool_result`` and
99
``meta=UI_META``. Others return plain Pydantic/dict responses.
10+
11+
The ``GET /orders/lookup`` endpoint is intentionally not exposed: it is the
12+
public, customer-verification path (requires ``number`` + ``email``) and adds
13+
nothing for an authenticated MCP caller, who can already use ``list_orders``
14+
(``search`` matches order number) or ``get_order`` (by id).
1015
"""
1116

1217
from __future__ import annotations
@@ -273,21 +278,6 @@ async def get_order(
273278
history_table=history_table,
274279
)
275280

276-
@mcp.tool(
277-
name="lookup_order",
278-
description="Look up an order by order number + customer email.",
279-
)
280-
async def lookup_order(
281-
context: Context,
282-
number: Annotated[
283-
str, Field(description="Order number, e.g. '1188' or '#1188'")
284-
],
285-
email: Annotated[str, Field(description="Customer email address")],
286-
) -> OrderSummary:
287-
services = get_services(context)
288-
order = await services.client.orders.lookup(number=number, email=email)
289-
return _to_summary(order)
290-
291281
@mcp.tool(
292282
name="update_order_status",
293283
description=(

0 commit comments

Comments
 (0)