list_contact_lists
Retrieve all contact lists from your SendGrid account to manage email marketing campaigns and audience segmentation.
Instructions
List all contact lists in your SendGrid account
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_contact_lists"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/sendgrid.ts:94-100 (handler)Core handler function that executes the API call to retrieve all contact lists from SendGrid's /v3/marketing/lists endpoint.
async listContactLists(): Promise<SendGridList[]> { const [response] = await this.client.request({ method: 'GET', url: '/v3/marketing/lists' }); return (response.body as { result: SendGridList[] }).result; } - src/tools/index.ts:450-461 (handler)Tool-specific handler in the main tool dispatcher that invokes the service method and formats the response as a JSON string.
case 'list_contact_lists': const lists = await service.listContactLists(); return { content: [{ type: 'text', text: JSON.stringify(lists.map(l => ({ id: l.id, name: l.name, contact_count: l.contact_count })), null, 2) }] }; - src/tools/index.ts:244-252 (registration)Tool registration including name, description, and input schema (no inputs required).
{ name: 'list_contact_lists', description: 'List all contact lists in your SendGrid account', inputSchema: { type: 'object', properties: {}, required: [] } }, - src/tools/index.ts:247-252 (schema)Input schema definition for the tool (empty object, no parameters required).
inputSchema: { type: 'object', properties: {}, required: [] } },