list_verified_senders
Retrieve all verified sender identities from your SendGrid account to manage email authentication and ensure deliverability.
Instructions
List all verified sender identities in your SendGrid account
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/index.ts:476-483 (handler)The handler logic for the 'list_verified_senders' tool within the handleToolCall switch statement. It calls service.getVerifiedSenders() and formats the response as JSON text.
case 'list_verified_senders': const senders = await service.getVerifiedSenders(); return { content: [{ type: 'text', text: JSON.stringify(senders, null, 2) }] }; - src/tools/index.ts:267-275 (schema)The input schema and metadata definition for the 'list_verified_senders' tool in the getToolDefinitions array.
{ name: 'list_verified_senders', description: 'List all verified sender identities in your SendGrid account', inputSchema: { type: 'object', properties: {}, required: [] } }, - src/services/sendgrid.ts:312-318 (helper)The core helper method in SendGridService that retrieves verified senders from the SendGrid API endpoint /v3/verified_senders.
async getVerifiedSenders() { const [response] = await this.client.request({ method: 'GET', url: '/v3/verified_senders' }); return response.body; } - src/index.ts:42-46 (registration)MCP server registration for listing tools, which includes 'list_verified_senders' via getToolDefinitions.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: getToolDefinitions(sendGridService) }; }); - src/index.ts:52-75 (registration)MCP server registration for tool calls, which routes to handleToolCall including the 'list_verified_senders' case.
server.setRequestHandler(CallToolRequestSchema, async (request) => { try { return await handleToolCall(sendGridService, request.params.name, request.params.arguments); } catch (error: any) { console.error('SendGrid Error:', error); // Handle SendGrid API errors if (error.response?.body?.errors) { throw new McpError( ErrorCode.InternalError, `SendGrid API Error: ${error.response.body.errors.map((e: { message: string }) => e.message).join(', ')}` ); } // Handle other errors if (error instanceof Error) { throw new McpError( ErrorCode.InternalError, error.message ); } throw new McpError(ErrorCode.InternalError, 'An unexpected error occurred'); }