Skip to main content
Glama
turbot
by turbot

steampipe_table_list

List available Steampipe tables with optional schema filtering and name pattern matching to find specific data sources.

Instructions

List all available Steampipe tables. Use schema and filter parameters to narrow down results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoOptional schema name to filter tables by. If not provided, lists tables from all schemas.
filterNoOptional filter pattern to match against table names. Use ILIKE syntax, including % as a wildcard.

Implementation Reference

  • The handler function that queries the database to list available Steampipe tables, optionally filtered by schema and table name pattern using ILIKE.
    handler: async (db: DatabaseService, args?: { schema?: string; filter?: string }) => {
      if (!db) {
        return {
          content: [{
            type: "text",
            text: "Database not available. Please ensure Steampipe is running and try again."
          }],
          isError: true
        };
      }
    
      try {
        // Check if schema exists if specified
        if (args?.schema) {
          const schemaQuery = `
            SELECT schema_name 
            FROM information_schema.schemata 
            WHERE schema_name = $1
          `;
          const schemaResult = await db.executeQuery(schemaQuery, [args.schema]);
          if (schemaResult.length === 0) {
            return {
              content: [{
                type: "text",
                text: `Schema '${args.schema}' not found`
              }],
              isError: true
            };
          }
        }
    
        // Build the query based on provided arguments
        let query = `
          SELECT DISTINCT 
            table_schema as schema,
            table_name as name,
            obj_description(format('%I.%I', table_schema, table_name)::regclass::oid, 'pg_class') as description
          FROM information_schema.tables
          WHERE table_schema NOT IN ('information_schema', 'pg_catalog')
        `;
    
        const params: any[] = [];
        let paramIndex = 1;
    
        if (args?.schema) {
          query += ` AND table_schema = $${paramIndex}`;
          params.push(args.schema);
          paramIndex++;
        }
    
        if (args?.filter) {
          query += ` AND table_name ILIKE $${paramIndex}`;
          params.push(args.filter); // Use the filter pattern as-is since it already includes wildcards
        }
    
        query += " ORDER BY table_schema, table_name";
    
        const result = await db.executeQuery(query, params);
        return {
          content: [{
            type: "text",
            text: JSON.stringify({ tables: result })
          }]
        };
      } catch (err) {
        logger.error("Error listing tables:", err);
        return {
          content: [{
            type: "text",
            text: `Failed to list tables: ${err instanceof Error ? err.message : String(err)}`
          }],
          isError: true
        };
      }
    }
  • Input schema defining optional 'schema' and 'filter' parameters for the tool.
    inputSchema: {
      type: "object",
      additionalProperties: false,
      properties: {
        schema: {
          type: "string",
          description: "Optional schema name to filter tables by. If not provided, lists tables from all schemas."
        },
        filter: {
          type: "string",
          description: "Optional filter pattern to match against table names. Use ILIKE syntax, including % as a wildcard."
        }
      }
    },
  • The tools export object where steampipe_table_list is registered by importing and assigning tableListTool.
    export const tools = {
      steampipe_query: queryTool as DbTool,
      steampipe_table_list: tableListTool as DbTool,
      steampipe_table_show: tableShowTool as DbTool,
      steampipe_plugin_list: pluginListTool as DbTool,
      steampipe_plugin_show: pluginShowTool as DbTool,
    } as const;
  • src/tools/index.ts:9-9 (registration)
    Import of the steampipe_table_list tool definition.
    import { tool as tableListTool } from './steampipe_table_list.js';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'lists' tables, which implies a read-only operation, but doesn't specify whether this requires authentication, how results are returned (e.g., pagination, format), or any rate limits. The description adds minimal behavioral context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just two sentences that are front-loaded and waste-free. The first sentence states the core purpose, and the second adds essential usage guidance, making every word earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 optional parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and hints at parameter usage but lacks details on behavioral aspects like authentication, result format, or error handling, which would be helpful for an agent to use it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description mentions that 'schema and filter parameters' can be used to 'narrow down results,' which adds some context about their purpose. However, with 100% schema description coverage, the input schema already fully documents both parameters, including their types, optionality, and usage details (e.g., ILIKE syntax for filter). The description provides only marginal value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List all available Steampipe tables') and the resource ('Steampipe tables'), making the purpose immediately understandable. However, it doesn't explicitly differentiate this tool from its sibling 'steampipe_table_show' which likely shows details of a specific table rather than listing all tables.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance by mentioning that schema and filter parameters can be used to 'narrow down results,' suggesting this tool is for listing tables with optional filtering. However, it doesn't explicitly state when to use this tool versus alternatives like 'steampipe_table_show' or 'steampipe_query,' nor does it provide exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/turbot/steampipe-mcp'

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