Castle MCP by usefulapi

v1.41.1
io.usefulapi/castle Checked 2 days ago Published 1 day ago

Investigate 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.

ParameterTypeDescription
filters *arrayCastle 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…
columnsarrayOnly return these event fields.
pageinteger1-based page number.
query_typestringReturn matching records, just a count, or both. Defaults to records.
results_sizeintegerResults 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.

ParameterTypeDescription
filters *arrayCastle 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 *arrayFields to group by, e.g. ["ip", "user.email"]. Names come from the event schema.
pageinteger1-based page number.
results_sizeintegerResults 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.

ParameterTypeDescription
filtersarrayOptional {field, op, value} filters over the lists themselves.
pageinteger1-based page number.
results_sizeintegerResults 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}.

ParameterTypeDescription
list_id *stringThe 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.

ParameterTypeDescription
list_id *stringThe list to search.
filtersarrayOptional {field, op, value} filters over the items.
pageinteger1-based page number.
results_sizeintegerResults 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.

ParameterTypeDescription
list_id *stringThe list to count.
filtersarrayOptional {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}.

ParameterTypeDescription
item_id *stringThe item's id.
list_id *stringThe 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.

ParameterTypeDescription
color *stringDashboard colour label, e.g. $red, $green, $blue — Castle requires one.
name *stringThe list name.
primary_field *stringThe event field entries match on, e.g. ip or user.email.
descriptionstringWhat this list is for.
secondary_fieldstringAn 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}.

ParameterTypeDescription
list_id *stringThe list to update.
colorstringNew colour label.
descriptionstringNew description.
namestringNew 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.

ParameterTypeDescription
author_identifier *stringWho is adding it, e.g. the analyst's email address.
author_type *stringWhat kind of actor is adding this entry.
list_id *stringThe list to add to.
primary_value *stringThe value to add, matching the list's primary_field.
auto_archives_atstringISO-8601 time to archive the entry automatically.
commentstringWhy this entry was added.
secondary_valuestringValue 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}.

ParameterTypeDescription
comment *stringThe new comment.
item_id *stringThe item to update.
list_id *stringThe 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.

ParameterTypeDescription
item_id *stringThe item to archive.
list_id *stringThe 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.

ParameterTypeDescription
item_id *stringThe item to restore.
list_id *stringThe list holding the item.