Skip to main content
Glama

nostr_decode

Decode a NIP-19 bech32 identifier to its raw fields without network calls. Bars nsec decoding by default to prevent private key exposure.

Instructions

Decode a NIP-19 bech32-encoded identifier (npub / nsec / note / nevent / naddr / nprofile) into its raw fields. Local-only — no network call. Refuses nsec unless NOSTR_ALLOW_NSEC_DECODE=true; guards against accidentally surfacing a private key in tool output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bech32YesA NIP-19 bech32 string (npub / nsec / note / nevent / naddr / nprofile). Decoding nsec is REFUSED by default — set NOSTR_ALLOW_NSEC_DECODE=true to opt in.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that it's a local operation (no network call) and that decoding nsec is refused by default unless an environment variable is set. This is important safety information. Lacks details on output format or error handling, but overall good.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, and additional behavioral detail in the second. No redundant information; every word contributes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a decode tool with no output schema, it mentions 'raw fields' but doesn't specify the structure. However, given the simplicity and the list of id types, the output is somewhat implied. Could be slightly improved by noting the output fields (e.g., prefix, hex, relays for nevent).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage with a description that already explains the bech32 string type and the nsec guard. The tool description adds context by listing the specific id types and reinforcing the safety behavior, adding value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it decodes NIP-19 bech32 identifiers into raw fields, listing the id types (npub/nsec/note/nevent/naddr/nprofile) and noting it's local-only. This distinguishes it from siblings like nostr_encode (which does the opposite).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tells when to use (to decode identifiers) and provides important context about nsec decoding with a guard. While it doesn't explicitly state alternatives or when not to use, the tool is unique enough that usage is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/llmops-pro/nostr-ops-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server