Skip to main content
Glama

list_tables

Retrieve and display all tables in an Azure Storage account, optionally filtering results by a provided prefix.

Instructions

List all tables in the storage account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
prefixNoOptional prefix to filter table names

Implementation Reference

  • The core handler function for the 'list_tables' tool. It uses TableServiceClient to iterate over all tables, filters by optional 'prefix' argument, collects table names, and returns them as a JSON-formatted text response.
    private async handleListTables(args: ListTablesArgs) { const serviceClient = TableServiceClient.fromConnectionString(this.connectionString); const tables = []; const iterator = serviceClient.listTables(); for await (const table of iterator) { if (table.name && (!args.prefix || table.name.startsWith(args.prefix))) { tables.push(table.name); } } return { content: [ { type: 'text', text: JSON.stringify(tables, null, 2), }, ], }; }
  • src/index.ts:129-141 (registration)
    Tool registration in the ListToolsRequest handler, defining name, description, and input schema for 'list_tables'.
    { name: 'list_tables', description: 'List all tables in the storage account', inputSchema: { type: 'object', properties: { prefix: { type: 'string', description: 'Optional prefix to filter table names', }, }, }, },
  • src/index.ts:167-169 (registration)
    Dispatch logic in CallToolRequest handler that routes 'list_tables' calls to the handleListTables function.
    case 'list_tables': const listArgs = request.params.arguments as ListTablesArgs; return await this.handleListTables(listArgs);
  • TypeScript interface defining the input parameters for the list_tables tool (optional prefix string). Used for type safety in handler and dispatch.
    interface ListTablesArgs { prefix?: string; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dkmaker/mcp-azure-tablestorage'

If you have feedback or need assistance with the MCP directory API, please join our Discord server