Check Credit Balance
deliveriq_check_creditsCheck your current credit balance and usage breakdown before performing credit-consuming operations. View remaining credits, plan tier, billing period, and usage by category.
Instructions
Check current credit balance, usage breakdown, and plan information. Use this before performing credit-consuming operations to verify sufficient balance.
Returns: Remaining credits, plan tier, billing period, and usage breakdown by category (single, batch, ESP sync).
Examples:
"How many credits do I have left?" -> {}
"What's my usage this month?" -> {}
Credit cost: Free
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- deliveriq-mcp/src/tools/account.ts:31-67 (handler)The async handler function that executes the deliveriq_check_credits tool logic. Calls client.account.usage() and formats the response with remaining credits, plan, period, and usage breakdown.
async () => { try { const res = await client.account.usage(); const lines = [ '# Credit Balance', '', `**Remaining**: ${res.remaining.toLocaleString()} of ${res.limit.toLocaleString()} credits`, `**Used**: ${res.used.toLocaleString()} (${((res.used / res.limit) * 100).toFixed(1)}%)`, `**Plan**: ${res.plan}`, `**Period**: ${res.periodStart} to ${res.periodEnd}`, '', '## Usage Breakdown', `| Category | Credits |`, `|----------|---------|`, `| Single verification | ${res.breakdown.single} |`, `| Batch verification | ${res.breakdown.batch} |`, `| ESP sync | ${res.breakdown.espSync} |`, `| **Total** | **${res.used}** |`, ]; if (res.dailyUsage.length > 0) { lines.push('', '## Recent Daily Usage'); const recent = res.dailyUsage.slice(-7); lines.push('| Date | Credits |', '|------|---------|'); for (const day of recent) { lines.push(`| ${day.date} | ${day.count} |`); } } return successResponse(lines.join('\n')); } catch (error) { return handleSdkError(error); } }, ); } - Input schema for the tool - an empty object with strict() validation, meaning the tool takes no parameters.
export const CheckCreditsSchema = z.object({}).strict(); - deliveriq-mcp/src/tools/account.ts:9-66 (registration)Registration of the deliveriq_check_credits tool on the MCP server, defining its title, description, inputSchema, and annotations.
server.registerTool( 'deliveriq_check_credits', { title: 'Check Credit Balance', description: `Check current credit balance, usage breakdown, and plan information. Use this before performing credit-consuming operations to verify sufficient balance. Returns: Remaining credits, plan tier, billing period, and usage breakdown by category (single, batch, ESP sync). Examples: - "How many credits do I have left?" -> {} - "What's my usage this month?" -> {} Credit cost: Free`, inputSchema: CheckCreditsSchema, annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, }, async () => { try { const res = await client.account.usage(); const lines = [ '# Credit Balance', '', `**Remaining**: ${res.remaining.toLocaleString()} of ${res.limit.toLocaleString()} credits`, `**Used**: ${res.used.toLocaleString()} (${((res.used / res.limit) * 100).toFixed(1)}%)`, `**Plan**: ${res.plan}`, `**Period**: ${res.periodStart} to ${res.periodEnd}`, '', '## Usage Breakdown', `| Category | Credits |`, `|----------|---------|`, `| Single verification | ${res.breakdown.single} |`, `| Batch verification | ${res.breakdown.batch} |`, `| ESP sync | ${res.breakdown.espSync} |`, `| **Total** | **${res.used}** |`, ]; if (res.dailyUsage.length > 0) { lines.push('', '## Recent Daily Usage'); const recent = res.dailyUsage.slice(-7); lines.push('| Date | Credits |', '|------|---------|'); for (const day of recent) { lines.push(`| ${day.date} | ${day.count} |`); } } return successResponse(lines.join('\n')); } catch (error) { return handleSdkError(error); } }, ); - deliveriq-mcp/src/index.ts:41-41 (registration)Top-level registration call that wires the account tools (including deliveriq_check_credits) into the MCP server.
registerAccountTools(server, client); - deliveriq-mcp/src/constants.ts:17-18 (helper)Credit cost definition for deliveriq_check_credits - set to 0 (free).
deliveriq_check_credits: 0, };