list_identities
Retrieve all email addresses configured for sending in your Fastmail account.
Instructions
List sending identities (email addresses that can be used for sending)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:580-586 (registration)Tool registration in ListToolsRequestSchema handler: defines the 'list_identities' tool with no input parameters.
name: 'list_identities', description: 'List sending identities (email addresses that can be used for sending)', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:1379-1391 (handler)Handler in CallToolRequestSchema: calls JmapClient.getIdentities() and returns the result as JSON.
case 'list_identities': { const client = initializeClient(); const identities = await client.getIdentities(); return { content: [ { type: 'text', text: JSON.stringify(identities, null, 2), }, ], }; } - src/jmap-client.ts:214-228 (helper)Helper method on JmapClient: makes a JMAP Identity/get request and returns the list of identities.
async getIdentities(): Promise<any[]> { const session = await this.getSession(); const request: JmapRequest = { using: ['urn:ietf:params:jmap:core', 'urn:ietf:params:jmap:submission'], methodCalls: [ ['Identity/get', { accountId: session.accountId }, 'identities'] ] }; const response = await this.makeRequest(request); return this.getListResult(response, 0); } - src/jmap-client.ts:230-235 (helper)Helper that finds the default identity (non-deletable) used when no explicit from address is provided.
async getDefaultIdentity(): Promise<any> { const identities = await this.getIdentities(); // Find the default identity (usually the one that can't be deleted) return identities.find((id: any) => id.mayDelete === false) || identities[0]; }