metlife-pets
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to query MetLife Pet Insurance, check pet insurance claims, list claims, get claim details, download EOBs…
от FDU-INS★ 84 звезды на GitHubОб этом скилле
MetLife Pet Insurance API
You are a helper for interacting with the MetLife Pet Insurance API.
Authentication
Authentication is handled by metlife.sh in the repo root. It supports:
- Programmatic login with username/password (2-step: login + profileDevice, with MFA support)
- MFA handling via email OTP (deliverOtpToDevice + VerifyOtp)
- Automatic token refresh using the refresh token (~15 min access token TTL)
- Token persistence across shell sessions via
.metlife-cache/.token - Proactive refresh before token expiry (120s buffer)
First-time setup / expired session
If ensure_auth returns AUTH_NEEDED, ask the user for their MetLife login credentials:
"I need to log into your MetLife account. What's your email and password for mypets.metlife.com?"
Then call:
source metlife.sh
LOGIN_RESULT=$(metlife_login "[email protected]" "their_password")
If login returns MFA_OTP_SENT (exit code 2): MetLife requires email verification. Ask the user to check their email for a verification code, then call:
source metlife.sh
metlife_verify_otp "123456"
If login completes without MFA: Tokens are saved automatically.
Important (zsh compatibility): Always run metlife.sh with bash or ensure the calling shell is bash. The script uses bash-specific features and avoids zsh reserved variable names.
Every Bash call
Always source metlife.sh and call ensure_auth at the top of every Bash tool invocation:
cd /path/to/claude-metlife
source metlife.sh
AUTH_RESULT=$(ensure_auth)
if [ "$AUTH_RESULT" = "AUTH_NEEDED" ]; then
echo "AUTH_NEEDED"
exit 0
fi
If AUTH_NEEDED is returned, stop and ask the user for credentials. Do not proceed with API calls.
Two API Gateways
MetLife uses two separate API gateways. The helper script handles headers for each automatically.
Azure APIM (apis.metlife.com) — pets, policies, rewards
Use metlife_apim for these endpoints:
| Endpoint | Description |
|---|---|
GET $APIM_BASE/pets |
List all pets |
GET $APIM_BASE/pets/{petId}/profile |
Pet profile details |
GET $APIM_BASE/pets/{petId}/profileImage |
Pet profile image (base64 JPEG) |
GET $APIM_BASE/policies |
List all policies |
GET $APIM_BASE/policies/{policyId} |
Policy details |
GET $APIM_BASE/rewards/active |
Active rewards |
GET $APIM_BASE/rewards/isAvailable |
Rewards availability |
IBM API Connect (api.metlife.com) — claims, customer, payments
Use metlife_ibm for these endpoints:
| Endpoint | Description |
|---|---|
GET $IBM_BASE/cl/v1/claim/all?petId={petId}&policyId={policyId} |
List all claims (pass policyId= empty for all policies) |
GET $IBM_BASE/cl/v1/incident/{claimSourceId}/{claimId}/incidents |
Claim incidents (line-item groups per pet/condition; claimSourceId is typically 1) |
GET $IBM_BASE/cl/v1/incident/{incidentId}/lineItems |
Incident line items (individual charges, denial reasons, exception messages) |
GET $IBM_BASE/cl/v1/document-details?policyId={policyId}&claimSourceId=1&claimId={claimId} |
List claim documents (EOBs and submitted docs) |
GET $IBM_BASE/cl/v1/document-details?..&isBlobRequest=true&filePath={filePath}&claimDocumentType=2 |
Download submitted docs (invoices, SOAP notes) |
GET $IBM_BASE/cl/v1/document-details?..&isBlobRequest=true&filePath={filePath}&claimDocumentType=1 |
Download EOB |
GET $IBM_BASE/p/v1/policy/{policyId}/policyPacket |
Policy packet PDF (binary response, save directly) |
GET $IBM_BASE/cu/v1/customer/details |
Customer profile |
You can also use metlife_api which auto-routes to the correct gateway based on the URL.
Document Downloads
Submitted documents (invoices, SOAP notes)
The filePath comes from the docDetails array in the document list response. Use claimDocumentType=1 (not 2). The response may return the document in either docDetails[].document or eobDetails[].eobDocument -- check both fields.
If a download returns null, try the other claimDocumentType and try both petIds on the policy. The API is inconsistent -- some documents only download with a specific petId even if tagged for multiple pets. URL-encode filePaths with spaces.
RESPONSE=$(metlife_ibm "$IBM_BASE/cl/v1/document-details?policyId=$POLICY&claimId=$CLAIM&petId=$PET&isBlobRequest=true&filePath=$FILE_PATH&claimDocumentType=1")
echo "$RESPONSE" | python3 -c "
import sys,json,base64
d=json.load(sys.stdin)
m=d.get('model',{})
for e in (m.get('eobDetails') or []):
if e.get('eobDocument'):
open('output.pdf','wb').write(base64.b64decode(e['eobDocument'])); break
else:
for doc in (m.get('docDetails') or []):
if doc.get('document'):
open('output.pdf','wb').write(base64.b64decode(doc['document'])); break
"
EOBs (Explanation of Benefits)
The filePath comes from the eobDetails array (eobFilePath field). Use claimDocumentType=1:
Установить metlife-pets в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл metlife-pets?
This skill should be used when the user asks to query MetLife Pet Insurance, check pet insurance claims, list claims, get claim details, download EOBs, download policy documents, or interact with the mypets.metlife.com API.
Как установить скилл metlife-pets?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл metlife-pets запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic