Skip to main content
Glama

nostr_send_dm

Encrypt and send a direct message on Nostr using NIP-44 or legacy NIP-04 encryption. The plaintext is encrypted before broadcast to the recipient's pubkey.

Instructions

Encrypt + send a NIP-04 (kind:4) direct message. Defaults to NIP-44 encryption (current standard); pass version="nip04" only for legacy compatibility. Gated by NOSTR_DM_TOOLS_ENABLED + NOSTR_DM_ALLOWLIST + rate limit. For modern sealed DMs (NIP-17) wait for the next version.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesPlaintext message; encrypted before broadcast.
versionNoEncryption scheme. Defaults to nip44 (current standard). NIP-04 is deprecated but widely deployed — use only if you know the recipient's client expects it.
to_pubkeyYesRecipient — 32-byte hex pubkey OR an npub bech32 string.
Behavior4/5

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

Describes encryption behavior and default version, and discloses gating conditions. No annotations exist, so description carries full burden. Could be improved by mentioning return value or success/error behavior, but current detail is adequate for a send operation.

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, no redundancy. Each sentence adds value: first states core purpose, second provides version guidance and gating. Front-loaded and efficient.

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?

Given no output schema and no annotations, description covers encryption, version choice, gating, and future alternative. Missing return value details, but overall sufficiently complete for a DM send tool.

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

Parameters4/5

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

Schema coverage is 100%, baseline 3. The description adds context beyond schema by clarifying default encryption and advising when to use nip04 for legacy compatibility. This enhances understanding of the version parameter.

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?

The description clearly states 'Encrypt + send a NIP-04 (kind:4) direct message', specifying the action and resource. It distinguishes from sibling tools like nostr_list_dms and nostr_decrypt_dm by focusing on sending, and mentions modern sealed DMs (NIP-17) as a separate future tool.

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

Usage Guidelines5/5

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

Explicitly provides when to use each encryption version: 'Defaults to NIP-44 encryption...pass version="nip04" only for legacy compatibility.' Also notes gating conditions (NOSTR_DM_TOOLS_ENABLED, NOSTR_DM_ALLOWLIST, rate limit) and directs users to wait for a future version for modern sealed DMs.

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