sendmux-token-efficient-usage
Use when the question is about *how to call* Sendmux cheaply, not what to send: choosing batch vs.
Skill by sendmux
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/sendmux-sendmux-token-efficient-usage-17515c
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: backend, writing, productivity, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
sendmux-token-efficient-usage- Description
- Use when the question is about *how to call* Sendmux cheaply, not what to send: choosing batch vs. looped sends, mailbox search/count/batch-read vs. full fetches, sync deltas, cursor pagination, ETags/conditional requests, idempotency keys, or picking between MCP, the sendmux CLI, an SDK, or direct HTTP. Trigger for reducing token/round-trip/API-call cost, avoiding broad mailbox or log fetches, or optimising a polling/sync loop. This is a routing/cost-decision skill, never a content-authoring one. If the request asks to write, draft, compose, or format the actual JSON body, subject, text, or attachment bytes of an email — even a single email, even one with an attachment, even inside a larger batch — do NOT use this skill; route that to sendmux-send-email or sendmux-attachments instead. Ask yourself: is the user asking "what's the cheapest way to call Sendmux," or "what should this email/attachment contain"? Only the former belongs here.
- License
- Apache-2.0
- Metadata
- author: sendmux · version: 1.0
- Instructions
- 283 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- openai.yaml · agents/
- evals.json · evals/
- trigger-evals.json · evals/
SKILL.md (first lines)
# Sendmux token-efficient usage
Use this skill to choose the lowest-cost Sendmux route that still answers the task correctly.
## Boundaries
- Do not ask the user to paste an API key.
- For API-key authentication, use `smx_mbx_*` keys for normal Mailbox calls.
- For a self-registered agent, reuse one durable CLI profile. Mailbox reads become available after provisioning, before owner approval; Sending stays blocked until owner approval.
- For API-key authentication, use `smx_root_*` for Management calls.
- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.
- Keep real attachment bytes outside model context and route their mechanics to `sendmux-attachments`; use the attachment route reference below.
- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.
Choose the authentication connection, then its already-approved product surface. For an existing OAuth profile, use the already-known approved surface from its granted permissions or setup context. If that surface is unknown, show the surface-specific alternatives below and ask which one the profile grants; there is no universal Mailbox default.
| Authentication connection | Validate with | Ownership boundary |
| --- | --- | --- |
| Existing CLI or REST OAuth profile | The selected CLI operation: `mailbox:get-connection`, `management:get-connection`, or `sending:get-connection` | Explain that the check stays within the profile's approved surface, scopes, and mailboxes. `sendmux-cli` owns login and refresh. |
| SDK application credentials | The selected SDK operation: `mailboxGetConnection`, `managementGetConnection`, or `sendingGetConnection` | The application supplies SDK credentials; this is not a CLI profile check. |
| Already-connected MCP session | The selected MCP operation: `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection` | This validates only that MCP session. `sendmux-mcp-setup` owns hosted MCP OAuth setup; it is not an alternate view of a REST profile. |
These checks need no mailbox selector and send no email. Public OpenAPI discovery does not validate credentials.
## Surface choice
| Situation | Use | Why |
| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |
| Connected agent and curated tool exists | MCP tool | Small schema and no SDK boilerplate. |
| One-off terminal task | `sendmux` CLI with `--json` | Direct, scriptable, exposes the full generated operation set. |
| Application code or repeated workflow | SDK for the project already in use | Reuses client setup, pagination, headers, and retry helpers. |
| MCP lacks the needed operation | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools. |
| No package/tooling available | Direct HTTP | Keep request bodies and headers aligned to OpenAPI. |
Credential ownership follows the surface. For a durable CLI agent profile, the CLI automatically exchanges and caches the one-hour delegated token for `sending:*` commands. SDK callers supply a compatible `apiKey` or `accessToken` (or their own provider callback); SDK helpers do not read or update CLI profile state.
## Cheapest-call map
| Task | Cheapest correct default |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Send one outbound email | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`. |
| Send multiple outbound emails | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends. |
| Send or read attachments | Use the attachment route reference below. |
| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`. |
| Search mailbox text | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |
| Read several known messages | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`. |
| Update/delete several messages | Batch update/delete after explicit confirmation. |
| Resume broad mailbox sync | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`. |
| Resume filtered mailbox sync | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet. |
| Watch live mailbox events | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet. |
| Scan threads | List threads, then fetch one thread or its messages. |
| Manage domains/mailboxes/keys | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work. |
| Manage sending accounts | CLI/SDK; MCP does not curate provider tools yet. |
| Manage webhooks | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads. |
| Inspect spend, logs, metrics | Metrics first; use `management:list-email-logs` / `managementListEmailLogs` for filtered summaries, then `management:get-email-log` / `managementGetEmailLog` for one selected row. |
### Attachment route reference
`sendmux-attachments` owns the detailed upload/download procedures and current direct-upload limits.
When comparing local-file routes, state how bytes move and which size authority applies for each alternative below, then recommend the one matching the user's environment:
1. **Terminal:** recommend CLI `--attach` for a one-off task. It uploads directly outside model context; server-enforced direct-upload limits apply. There is no presign-limit response.
2. **Application code:** name `sendEmailWithFiles` or `uploadAttachmentFromFile` from `@sendmux/sending/node`, or `uploadMailboxAttachmentFromFile` from `@sendmux/mailbox/node`. These helpers upload directly outside model context; server-enforced direct-upload limits apply, with no presign-limit response.
3. **Connected MCP:** name `sending_create_attachment_upload` for Sending, or `mailbox_upload_attachment` with `presign_upload_url=true` for Mailbox. Both use presigned external transfer outside model context. For Sending, obey the upload intent's returned `max_size_bytes`; Mailbox accepts requested `size_bytes` up to 7,500,000.
For tiny agent-authored content, MCP inline `content_base64` is available only after measuring the decoded content at no more than 32,768 bytes; a filename or file type cannot establish eligibility.
For presigned Sending uploads, the intent returns a temporary `upload_id`; take the final `attachment_id` from the successful external `PUT` response. A successful external Mailbox upload returns the `blob_id` for Mailbox sends. Never use MCP `file_path` or real-file inline base64.
For an agent with no key, avoid manual protocol calls and token copying:
```bash
sendmux agent:register my-agent --default --json
sendmux mailbox:me:get --profile my-agent --json
sendmux agent:invite-owner owner@example.com --profile my-agent --json
```
Register once, then reuse the durable profile across processes. For this self-registered agent, sending has two owner gates: the owner accepts the invitation, then explicitly approves sending. Once both are complete, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.
Explain the storage boundary alongside this setup: the inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.
## Read less
For mailbox questions, reduce the result set before reading content:
1. Count when the user asks "how many" or when the query may be broad.
2. Search snippets with a small `limit` when the user needs examples; choose from the returned `message_id`, `subject`, and `preview` fields.
3. Batch-get only selected message IDs.
4. Request clean body/content only when message text affects the answer.
CLI:
```bash
sendmux mailbox:count-messages \
--query q=invoice \
--query is_unread=true \
--json
sendmux mailbox:search-message-snippets \
--query q=invoice \
--query is_unread=true \
--query limit=10 \
--json
sendmux mailbox:batch-get-messages \
--body '{
"ids": ["eml_abc", "eml_def"],
"body_mode": "clean_json",
"max_body_chars": 4000,
"strip_quotes": true,
"strip_signature": true,
"include_attachments": "metadata"
}' \
--json
```
## Write fewer requestsFrom Sendmux/skills, Apache-2.0.
More from Sendmux/skills
- 0.642score
sendmux-attachments
sendmux
Use Sendmux attachment workflows without wasting model context on base64.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-cli
sendmux
Use when a user wants to run the Sendmux **CLI** (the `sendmux` terminal binary) — installing it, OAuth login/logout, connection checks, agent inbox…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-email-for-agents
sendmux
Use when a user wants to design or plan how an AI agent gets and uses email — giving an agent its own inbox, deciding between owner-managed vs self-registered…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-getting-started
sendmux
Use when a user needs Sendmux setup, OAuth connection checks, agent inbox registration, owner linking, credential validation, surface selection, or a first…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-mailbox-agent
sendmux
Operate inside an already-existing Sendmux mailbox on behalf of an AI agent: read, search, count, sync, triage, file, delete, thread, save or edit a reply…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-management
sendmux
Use this skill for Sendmux account/team administration with a root API key or Management-scoped OAuth connection.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-mcp-setup
sendmux
Set up, configure, and troubleshoot Sendmux Model Context Protocol (MCP) servers for AI agent clients.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-send-email
sendmux
Use when a user needs advice or implementation help for sending one or many emails through Sendmux: choose the HTTP Sending API versus SMTP, design single or…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-token-efficient-usage
sendmux
Use when the question is about *how to call* Sendmux cheaply, not what to send: choosing batch vs.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
agent-email-inbox
sendmux
Use when an AI agent needs read-only triage of an existing Sendmux inbox or unsent reply text from its messages.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
email-for-ai-agents
sendmux
Use when an AI agent needs to send one outbound email through Sendmux with human approval, including a status notification or delegated agent send.
SkillAFreshness: A★ 18Claude Code +9
Signals
- Stars
- 18
- Forks
- 1
- Open issues
- 1
- Last commit (this folder)
- Sep 15, 2026 (1 month ago)
- Last release
- Oct 15, 2026 (14 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- Apache-2.0
- Repository
- github.com/Sendmux/skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from sendmux
- 0.642score
sendmux-attachments
sendmux
Use Sendmux attachment workflows without wasting model context on base64.
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-cli
sendmux
Use when a user wants to run the Sendmux **CLI** (the `sendmux` terminal binary) — installing it, OAuth login/logout, connection checks, agent inbox…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-email-for-agents
sendmux
Use when a user wants to design or plan how an AI agent gets and uses email — giving an agent its own inbox, deciding between owner-managed vs self-registered…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-getting-started
sendmux
Use when a user needs Sendmux setup, OAuth connection checks, agent inbox registration, owner linking, credential validation, surface selection, or a first…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-mailbox-agent
sendmux
Operate inside an already-existing Sendmux mailbox on behalf of an AI agent: read, search, count, sync, triage, file, delete, thread, save or edit a reply…
SkillAFreshness: A★ 18Claude Code +9 - 0.642score
sendmux-management
sendmux
Use this skill for Sendmux account/team administration with a root API key or Management-scoped OAuth connection.
SkillAFreshness: A★ 18Claude Code +9
Cite this page
sendmux-token-efficient-usage skill. Agent Mart. https://agentmart.dev/skills/sendmux-sendmux-token-efficient-usage-17515c (last updated 2026-10-24)