Topolo Docs Topolo Platform
Open workspace

Get Inventory dashboard

Read active items, locations, low-stock items and recent ledger entries in the granted workspace. movementCount is the length of the latest 100 movement rows, and recentMovements contains at most ten.

Outcome

Read active items, locations, low-stock items and recent ledger entries in the granted workspace. movementCount is the length of the latest 100 movement rows, and recentMovements contains at most ten.

Before you start

  • Verify the authenticated identity, exact environment and pinned approved organization context before preparing an action.
  • The published application permission is workspace:read. Discover a granted Inventory workspace and bind that exact resource. Supplied identifiers do not grant access.

Discover the target

topolo whoami --json
topolo actions get app_topolo_inventory.dashboard.get --detail --json
topolo resources topolo-inventory --json
topolo workspaces list topolo-inventory --json
  • Select the exact granted workspace id as INVENTORY_WORKSPACE_ID. Fixture ids authorize no live operation.

Request

GET /api/dashboard

Save action input as payload.json. Inspect the plan for the exact path, query and body. Set INVENTORY_WORKSPACE_ID from granted resource discovery.

Inspect and test this action in the signed action console, then perform the verification below.

Input fields

Supply an empty input object; credential and resource context are separate.

View the complete input schema in the action console. The same schema is available through CLI and MCP action discovery.

Effects

  • Reads both databases scoped to organization and verified workspace; it does not initialize a mirror.
  • Only active items count or appear as low stock. quantityOnHand sums every signed movement delta regardless of review status; quantity at or below threshold is low stock, including zero threshold.
  • Movement listing is capped at 100 newest rows; movementCount is not all-time total and recentMovements is its first ten.

Interpret the response

No new resource identifier is returned. The target is the separately resolved workspace resource; item and movement ids in result arrays are existing records.

Compare lowStockItems quantityOnHand to lowStockThreshold; an archived item is excluded from active counts. Use widget.get for an all-time movement count; no movement cursor is returned by this action.

The success schema was checked against captured handler responses. Delegated Auth profile and canonical widget context fields can vary; exact Inventory projections and all six raw SQL export stores are source-reviewed. Error examples retain their actual refusal shapes.

View the complete success schema in the action console. The worked examples below retain complete captured responses; action discovery supplies the exact schema.

Worked examples

Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Refused examples demonstrate boundaries and must not be executed as successful workflows.

Successful request

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: empty dashboard.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_inventory.dashboard.get --data @payload.json --json
topolo actions plan app_topolo_inventory.dashboard.get --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_inventory.dashboard.get --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_inventory.dashboard.get",
    "input": {},
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "dashboard": {
    "itemCount": 0,
    "locationCount": 0,
    "movementCount": 0,
    "lowStockCount": 0,
    "lowStockItems": [],
    "recentMovements": []
  }
}

HTTP 200. Compare lowStockItems quantityOnHand to lowStockThreshold; an archived item is excluded from active counts. Use widget.get for an all-time movement count; no movement cursor is returned by this action.

Another supported request

Actual exported Worker response with both local SQLite D1 databases and all committed migrations; synthetic Auth/grants and simulated Notify/Nexus/archive transport. No live delivery, billing or environment deployment proof. Captured scenario: populated dashboard includes low stock.

Input · payload.json:

{}

CLI:

topolo actions validate app_topolo_inventory.dashboard.get --data @payload.json --json
topolo actions plan app_topolo_inventory.dashboard.get --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json
topolo actions call app_topolo_inventory.dashboard.get --resource-type workspace --resource-id "$INVENTORY_WORKSPACE_ID" --data @payload.json --json

MCP tool and arguments:

{
  "tool": "topolo_read_action",
  "arguments": {
    "actionId": "app_topolo_inventory.dashboard.get",
    "input": {},
    "resourceType": "workspace",
    "resourceId": "<identifier returned by granted resource discovery>"
  }
}

Captured local response · HTTP 200:

{
  "dashboard": {
    "itemCount": 1,
    "locationCount": 1,
    "movementCount": 2,
    "lowStockCount": 1,
    "lowStockItems": [
      {
        "id": "invitem_cf12df06-7056-4441-bef4-95d5c15ef1ed",
        "workspaceId": "ws_inventory_fixture",
        "sku": "WIDGET-BLUE",
        "name": "Blue widget",
        "description": "",
        "unit": "unit",
        "status": "active",
        "lowStockThreshold": 5,
        "quantityOnHand": 0,
        "createdByUserId": "usr_inventory_fixture",
        "createdByEmail": "operator@example.test",
        "createdAt": "2026-10-04T05:46:37.050Z",
        "updatedAt": "2026-10-04T05:46:37.050Z"
      }
    ],
    "recentMovements": [
      {
        "id": "invmove_16afb7cb-6c3f-4051-a68e-3988135bf040",
        "itemId": "invitem_cf12df06-7056-4441-bef4-95d5c15ef1ed",
        "locationId": "invloc_cfa27344-e120-4c97-90e4-7e876b0a5e3e",
        "movementType": "adjustment",
        "quantityDelta": -10,
        "note": "Compensating correction",
        "itemName": "Blue widget",
        "itemSku": "WIDGET-BLUE",
        "locationName": "Main warehouse",
        "createdByUserId": "usr_inventory_fixture",
        "createdByEmail": "operator@example.test",
        "createdAt": "2026-10-04T05:46:37.212Z",
        "reviewStatus": "approved",
        "reviewReason": "Absolute quantity delta 10 met the configured threshold 10.",
        "reviewedByUserId": "usr_inventory_fixture",
        "reviewedAt": "2026-10-04T05:46:37.232Z"
      },
      {
        "id": "invmove_3847adc5-c5b0-452d-87a0-37b1272057be",
        "itemId": "invitem_cf12df06-7056-4441-bef4-95d5c15ef1ed",
        "locationId": "invloc_cfa27344-e120-4c97-90e4-7e876b0a5e3e",
        "movementType": "receipt",
        "quantityDelta": 10,
        "note": "",
        "itemName": "Blue widget",
        "itemSku": "WIDGET-BLUE",
        "locationName": "Main warehouse",
        "createdByUserId": "usr_inventory_fixture",
        "createdByEmail": "operator@example.test",
        "createdAt": "2026-10-04T05:46:37.131Z",
        "reviewStatus": "rejected",
        "reviewReason": "Absolute quantity delta 10 met the configured threshold 10.",
        "reviewedByUserId": "usr_inventory_fixture",
        "reviewedAt": "2026-10-04T05:46:37.164Z"
      }
    ]
  }
}

HTTP 200. Compare lowStockItems quantityOnHand to lowStockThreshold; an archived item is excluded from active counts. Use widget.get for an all-time movement count; no movement cursor is returned by this action.

Verify the result

  • Compare lowStockItems quantityOnHand to lowStockThreshold; an archived item is excluded from active counts.
  • Use widget.get for an all-time movement count; no movement cursor is returned by this action.

Errors and recovery

  • invalid_action_input (HTTP 400): Correct only the exact fields reported by the published schema validator. An invalid input can be refused before its handler.
  • action_permission_required (HTTP 403): Stop when the verified credential lacks the published action permission. Resource identifiers and organization ownership do not grant that permission.
  • organization_required (HTTP 403): Use the specifically authorized organization context; personal scope cannot act on organization-owned Inventory data.
  • workspace_required (HTTP 400): Discover an authorized Inventory workspace and pass its exact separate resource binding; bootstrap does not select a workspace.
  • workspaces_unavailable (HTTP 503): Retain the request id and report unavailable canonical workspace discovery; do not invent a default workspace.

Auth, action-input validation and platform resource resolution can refuse a request before its handler. Retain the exact error, request id and context; requesting another context is not a legitimate way to bypass a refusal.

Recovery boundary

The read does not change local inventory records. No local rollback is needed; do not perform a mutation merely to reverse a read.

  • List Inventory items: List all workspace items, including archived records, newest update first. Every quantityOnHand sums all signed ledger deltas across locations and review states; there is no pagination.
  • List Inventory stock movements: Read up to 100 newest ledger entries in the granted workspace, enriched with item/location labels. Every review state is included and there is no cursor or full-ledger export on this action.
  • Get Inventory workspace widget: Read the granted workspace summary with active SKU count, location count, all-time movement count and seven UTC-day movement/net quantity series. Widget totals differ from the dashboard movement count capped at 100.

Evidence

Captured exported Worker responses use both real local SQLite D1 databases with all six committed migrations, synthetic Auth/workspace grants and simulated Notify/Nexus/archive transport. They prove local handler shapes and scoped behavior, not live authorization, notification delivery, metering acceptance or environment deployment. Large 100-row list/capped-dashboard captures are retained in local evidence; committed tests verify those limits while worked guides use smaller complete responses. Capture digests and test scenarios are retained in the source fixture records.