# relay-query

Query events from Nostr relays by kind, author, ids, tags, or time range. Useful for discovering events, scanning for specific kinds, or investigating unknown event schemas. Uses explicit relays if provided, otherwise the active identity\

Agent View of the PolicyLayer registry record for `relay-query`. HTML page: https://policylayer.com/tools/dev-forgesworn-bray/relay-query

## Facts

- Tool: `relay-query`
- Server: Nostr Bray (`nostr-bray`) — https://policylayer.com/tools/dev-forgesworn-bray.md
- Install: `npx -y nostr-bray`
- Homepage: https://github.com/forgesworn/bray
- Risk category: Read (Low risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Allowed

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "relay-query",
    "arguments": {}
  }
}
```

## Why relay-query is rated Low

This tool retrieves data from Nostr relays without creating, modifying, or deleting information. However, severity is medium rather than low because: (1) querying Nostr events could expose private or sensitive information depending on event kinds and filters; (2) an AI agent could use relay-query to enumerate users, discover DMs, or scan for specific content patterns; (3) the 'active identity' context suggests the…

From the tool's own definition: "Tool description states it 'Query events from Nostr relays' and is 'Useful for discovering events, scanning for specific kinds, or investigating unknown event schemas.' The verb 'query' and the purpose of retrieving/discovering data without modification…"

## Use case

AI agents call relay-query to retrieve information from Nostr Bray without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.

## Recommended policy (PolicyLayer)

Verdict: **Allowed**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Nostr Bray:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "relay-query": {}
  }
}
```

## Other tools on Nostr Bray (239)

- `blossom-delete` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/blossom-delete.md
- `group-remove-user` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/group-remove-user.md
- `label-remove` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/label-remove.md
- `marketplace-credentials-clear` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/marketplace-credentials-clear.md
- `marketplace-retire` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/marketplace-retire.md
- `social-delete` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/social-delete.md
- `tombstone` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/tombstone.md
- `trust-revoke` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/trust-revoke.md
- `vault-revoke` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/vault-revoke.md
- `zap-wallet-clear` — Destructive — https://policylayer.com/tools/dev-forgesworn-bray/zap-wallet-clear.md
- `cast-spell` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/cast-spell.md
- `execute-action` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/execute-action.md
- `identity-restore-shamir` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/identity-restore-shamir.md
- `identity-switch` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/identity-switch.md
- `marketplace-probe` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/marketplace-probe.md
- `nip44-encrypt` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/nip44-encrypt.md
- `onboard-verified` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/onboard-verified.md
- `relay-auth` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/relay-auth.md
- `trust-attest-chain` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/trust-attest-chain.md
- `trust-ring-lsag-sign` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/trust-ring-lsag-sign.md
- `trust-ring-prove` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/trust-ring-prove.md
- `trust-spoken-verify` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/trust-spoken-verify.md
- `vault-encrypt` — Execute — https://policylayer.com/tools/dev-forgesworn-bray/vault-encrypt.md
- `marketplace-pay` — Financial — https://policylayer.com/tools/dev-forgesworn-bray/marketplace-pay.md
- `zap-make-invoice` — Financial — https://policylayer.com/tools/dev-forgesworn-bray/zap-make-invoice.md
- `zap-send` — Financial — https://policylayer.com/tools/dev-forgesworn-bray/zap-send.md
- `article-list` — Read — https://policylayer.com/tools/dev-forgesworn-bray/article-list.md
- `article-read` — Read — https://policylayer.com/tools/dev-forgesworn-bray/article-read.md
- `badge-list` — Read — https://policylayer.com/tools/dev-forgesworn-bray/badge-list.md
- `blossom-check` — Read — https://policylayer.com/tools/dev-forgesworn-bray/blossom-check.md
- …and 209 more: https://policylayer.com/tools/dev-forgesworn-bray.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=dev-forgesworn-bray · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dev-forgesworn-bray
