list_sns_topics
Retrieve all Amazon SNS topics from your AWS account to manage messaging services and monitor topic configurations.
Instructions
Lists all SNS topics.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:2134-2139 (handler)Executes ListTopicsCommand via SNSClient to list all SNS topics and returns their ARNs as JSON.if (name === "list_sns_topics") { const command = new ListTopicsCommand({}); const response = await snsClient.send(command); const topics = response.Topics?.map(t => ({ TopicArn: t.TopicArn })) || []; return { content: [{ type: "text", text: JSON.stringify(topics, null, 2) }] }; }
- src/index.ts:686-692 (registration)Registers the list_sns_topics tool in ListTools handler with description and empty input schema.name: "list_sns_topics", description: "Lists all SNS topics.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:69-69 (helper)Initializes the SNSClient instance used by the list_sns_topics handler.const snsClient = new SNSClient({});
- src/index.ts:35-35 (helper)Imports SNSClient and ListTopicsCommand required for the tool implementation.import { SNSClient, ListTopicsCommand, ListSubscriptionsCommand } from "@aws-sdk/client-sns";