Api patterns

From wyre-technology/msp-claude-plugins · View interactive version

Api patterns is an AI agent skill from the GitHub repository wyre-technology/msp-claude-plugins. Crewhu MCP fundamentals: token authentication via the `X-Crewhu-Api-Token` header and its gateway env-var mapping, the flat 18-tool surface across the surveys, users, badges, and prizes domains (only `crewhu_badges_update_contest` writes), pagination, and error codes.

How to use this skill

Skill file

Crewhu MCP Tools & API Patterns

Overview

The Crewhu MCP server exposes CSAT/NPS surveys, employee recognition

(badges), and prize/redemption data for MSP teams. The tool surface is

read-heavy — only crewhu_badges_update_contest performs writes.

Connection & Authentication

Crewhu uses an API token passed via header:

| Header | Value |

|--------|-------|

| X-Crewhu-Api-Token | The raw API token |

The token is stored on the Crewhu connection in Conduit, which injects

it as X-Crewhu-Api-Token on every request; nothing is set on the

client.

Tool Surface

All 18 tools are exposed flat via tools/list — there is no

navigation gating. Tool names follow crewhu_<domain>_<action>

across four domains:

Pagination

Crewhu list endpoints typically accept page/limit-style parameters.

Always check whether more pages exist before claiming a result set is

complete; for survey trend analysis, pull enough history to have a

stable denominator.

Error Handling

| Status | Meaning | Action |

|--------|---------|--------|

| 401 | Missing or invalid token | Re-check the API token on the Crewhu connection in Conduit |

| 403 | Token valid but not authorized for this resource | Check token scope |

| 404 | Unknown survey / user / badge / prize ID | Re-list to confirm |

| 429 | Rate limit | Back off and retry |

Best Practices

the only tool in the surface that mutates data.

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.