Castle MCP by usefulapi
v1.41.1Investigate security events and manage the allow/deny lists an analyst acts on.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
castle_get_events_schema Get the event schema
List the event fields you can filter and group on, with their types. Read this first — the other query tools need real field names. Castle: GET /v1/events/schema.
castle_search_events Search security events
Query the security event stream — logins, registrations, transactions and their risk verdicts. Read-only despite being a POST: Castle takes the query in the body. Castle: POST /v1/events/query.
| Parameter | Type | Description |
|---|---|---|
filters * | array | Castle query filters, ANDed together. Each is {field, op, value} — e.g. {"field":"user.email","op":"$eq","value":"a@example.com"}. Operators: $eq, $neq, $in, $nin, $like, $nlike, $contains, $ncontai… |
columns | array | Only return these event fields. |
page | integer | 1-based page number. |
query_type | string | Return matching records, just a count, or both. Defaults to records. |
results_size | integer | Results per page, 1-100. |
castle_group_events Group security events
Aggregate matching events by one or more fields — the fast way to see which IPs, devices or countries dominate a spike. Read-only despite being a POST. Castle: POST /v1/events/group.
| Parameter | Type | Description |
|---|---|---|
filters * | array | Castle query filters, ANDed together. Each is {field, op, value} — e.g. {"field":"user.email","op":"$eq","value":"a@example.com"}. Operators: $eq, $neq, $in, $nin, $like, $nlike, $contains, $ncontai… |
group_by_fields * | array | Fields to group by, e.g. ["ip", "user.email"]. Names come from the event schema. |
page | integer | 1-based page number. |
results_size | integer | Results per page, 1-100. |
castle_search_lists Search lists
Find the allow/deny lists defined in the environment. Read-only despite being a POST. Castle: POST /v1/lists/query.
| Parameter | Type | Description |
|---|---|---|
filters | array | Optional {field, op, value} filters over the lists themselves. |
page | integer | 1-based page number. |
results_size | integer | Results per page, 1-100. |
castle_get_list Get one list
Fetch a single list with its primary and secondary field definitions. Castle: GET /v1/lists/{id}.
| Parameter | Type | Description |
|---|---|---|
list_id * | string | The list's id. |
castle_search_list_items Search items in a list
Search the entries of one list — the blocked IPs, emails or device ids it holds. Read-only despite being a POST. Castle: POST /v1/lists/{list_id}/items/query.
| Parameter | Type | Description |
|---|---|---|
list_id * | string | The list to search. |
filters | array | Optional {field, op, value} filters over the items. |
page | integer | 1-based page number. |
results_size | integer | Results per page, 1-100. |
castle_count_list_items Count items in a list
Count the entries in one list, with the same optional filters as the search. Read-only despite being a POST. Castle: POST /v1/lists/{list_id}/items/count.
| Parameter | Type | Description |
|---|---|---|
list_id * | string | The list to count. |
filters | array | Optional {field, op, value} filters over the items. |
castle_get_list_item Get one list item
Fetch a single list entry — its value, who added it, the comment and its archive time. Castle: GET /v1/lists/{list_id}/items/{id}.
| Parameter | Type | Description |
|---|---|---|
item_id * | string | The item's id. |
list_id * | string | The list holding the item. |
castle_create_list Create a list
Create a new allow or deny list. primary_field is the event field its entries match on, e.g. ip or user.email. Castle: POST /v1/lists.
| Parameter | Type | Description |
|---|---|---|
color * | string | Dashboard colour label, e.g. $red, $green, $blue — Castle requires one. |
name * | string | The list name. |
primary_field * | string | The event field entries match on, e.g. ip or user.email. |
description | string | What this list is for. |
secondary_field | string | An optional second field entries also carry. |
castle_update_list Update a list
Rename a list or change its colour or description. Castle: PUT /v1/lists/{id}.
| Parameter | Type | Description |
|---|---|---|
list_id * | string | The list to update. |
color | string | New colour label. |
description | string | New description. |
name | string | New name. |
castle_create_list_item Add an item to a list
Add an entry to a list — for example block an IP or an email. This changes live policy behaviour. Castle: POST /v1/lists/{list_id}/items.
| Parameter | Type | Description |
|---|---|---|
author_identifier * | string | Who is adding it, e.g. the analyst's email address. |
author_type * | string | What kind of actor is adding this entry. |
list_id * | string | The list to add to. |
primary_value * | string | The value to add, matching the list's primary_field. |
auto_archives_at | string | ISO-8601 time to archive the entry automatically. |
comment | string | Why this entry was added. |
secondary_value | string | Value for the list's secondary_field. |
castle_update_list_item Update a list item's comment
Change the comment on a list entry. Castle: PUT /v1/lists/{list_id}/items/{id}.
| Parameter | Type | Description |
|---|---|---|
comment * | string | The new comment. |
item_id * | string | The item to update. |
list_id * | string | The list holding the item. |
castle_archive_list_item Archive a list item
Archive a list entry so it stops matching. Reversible with castle_unarchive_list_item. Castle: DELETE /v1/lists/{list_id}/items/{id}/archive.
| Parameter | Type | Description |
|---|---|---|
item_id * | string | The item to archive. |
list_id * | string | The list holding the item. |
castle_unarchive_list_item Unarchive a list item
Restore a previously archived list entry so it matches again. Castle: PUT /v1/lists/{list_id}/items/{id}/unarchive.
| Parameter | Type | Description |
|---|---|---|
item_id * | string | The item to restore. |
list_id * | string | The list holding the item. |