list_identities
List all sending identities associated with your Fastmail account, providing the email addresses you can use as senders.
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:576-583 (registration)Tool 'list_identities' is registered in the ListToolsRequestSchema handler with its description and empty input schema.
{ name: 'list_identities', description: 'List sending identities (email addresses that can be used for sending)', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:1376-1388 (handler)Handler for 'list_identities' tool call: initializes the JMAP client and calls client.getIdentities(), returning 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)The getIdentities() method on JmapClient which performs the JMAP Identity/get API call to fetch sending 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)The getDefaultIdentity() helper method that finds the default identity (the one with mayDelete===false) from the identities list.
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]; }