Skip to main content
Glama
git-scarrow

Oracle MCP Server

by git-scarrow

list_tables

Retrieve table names from Oracle database schemas using optional filters for schema and table patterns to identify available data structures.

Instructions

List tables from specified schema or all accessible schemas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemaNoSchema name (optional, shows all accessible schemas if not specified)
patternNoTable name pattern (supports % wildcards)

Implementation Reference

  • The main handler function for the 'list_tables' tool. It constructs a dynamic SQL query against the ALL_TABLES view, applying optional filters for schema and table name pattern, executes it using the shared executeQuery method, and returns the results as JSON-formatted text content.
    async handleListTables(args) {
      let query = `
        SELECT 
          owner AS schema_name,
          table_name,
          num_rows,
          last_analyzed
        FROM all_tables
        WHERE 1=1
      `;
      const params = [];
      
      if (args.schema) {
        query += ` AND owner = :1`;
        params.push(args.schema.toUpperCase());
      }
      
      if (args.pattern) {
        query += ` AND table_name LIKE :${params.length + 1}`;
        params.push(args.pattern.toUpperCase());
      }
      
      query += ` ORDER BY owner, table_name`;
      
      const result = await this.executeQuery(query, params);
      
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result.rows, null, 2)
          }
        ]
      };
    }
  • src/index.js:194-210 (registration)
    Tool registration in the ListToolsRequestHandler response. Defines the tool name, description, and input schema specifying optional 'schema' and 'pattern' parameters.
    {
      name: 'list_tables',
      description: 'List tables from specified schema or all accessible schemas',
      inputSchema: {
        type: 'object',
        properties: {
          schema: {
            type: 'string',
            description: 'Schema name (optional, shows all accessible schemas if not specified)'
          },
          pattern: {
            type: 'string',
            description: 'Table name pattern (supports % wildcards)'
          }
        }
      }
    },
  • Input schema definition for the list_tables tool, validating optional schema name and table pattern parameters.
    inputSchema: {
      type: 'object',
      properties: {
        schema: {
          type: 'string',
          description: 'Schema name (optional, shows all accessible schemas if not specified)'
        },
        pattern: {
          type: 'string',
          description: 'Table name pattern (supports % wildcards)'
        }
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It implies a read-only operation by using 'List', but doesn't disclose permissions needed, rate limits, pagination behavior, or what 'accessible schemas' means in practice. The description is too vague to fully inform the agent about behavioral traits.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple listing tool and front-loads the core functionality.

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?

For a simple read operation with 100% schema coverage but no annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks important context about behavioral aspects, usage guidelines, and what the output will contain. The absence of output schema means the description should ideally hint at return format.

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?

Schema description coverage is 100%, so the input schema already documents both parameters thoroughly. The description adds marginal value by mentioning the schema parameter's optional nature and the concept of 'accessible schemas', but doesn't provide additional syntax, format details, or examples beyond what the schema provides.

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 verb ('List') and resource ('tables'), specifying the scope ('from specified schema or all accessible schemas'). It distinguishes from siblings like 'list_schemas' by focusing on tables rather than schemas. However, it doesn't explicitly differentiate from other table-related tools like 'describe_table' or 'get_table_constraints'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'list_schemas' for schema listing or 'describe_table' for detailed table information. It mentions the optional schema parameter but doesn't explain usage scenarios or prerequisites.

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/git-scarrow/oracle-mcp-server'

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