Skip to main content
Glama
egarcia74

Warp SQL Server MCP

by egarcia74

get_table_data

Retrieve sample data from SQL Server tables with optional filtering and row limits for database analysis and exploration.

Instructions

Get sample data from a table with optional filtering and limiting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
table_nameYesName of the table
databaseNoDatabase name (optional)
schemaNoSchema name (optional, defaults to dbo)
limitNoMaximum number of rows to return (optional, defaults to 100)
whereNoWHERE clause conditions (optional)

Implementation Reference

  • Main implementation of get_table_data tool: constructs paginated SELECT query for the specified table and executes it via executeQuery
    /**
     * Get table data with pagination support
     */
    async getTableData(tableName, database = null, schema = 'dbo', limit = 100, offset = 0) {
      let query;
    
      if (database) {
        query = `
          SELECT * 
          FROM [${database}].[${schema}].[${tableName}]
          ORDER BY (SELECT NULL)
          OFFSET ${offset} ROWS 
          FETCH NEXT ${limit} ROWS ONLY
        `;
      } else {
        query = `
          SELECT * 
          FROM [${schema}].[${tableName}]
          ORDER BY (SELECT NULL)
          OFFSET ${offset} ROWS 
          FETCH NEXT ${limit} ROWS ONLY
        `;
      }
    
      const result = await this.executeQuery(query, 'get_table_data');
      return this.formatResults(result);
    }
  • Input schema and metadata definition for the get_table_data tool used in tool listing
    {
      name: 'get_table_data',
      description: 'Get sample data from a table with optional filtering and limiting',
      inputSchema: {
        type: 'object',
        properties: {
          table_name: { type: 'string', description: 'Name of the table' },
          database: { type: 'string', description: 'Database name (optional)' },
          schema: { type: 'string', description: 'Schema name (optional, defaults to dbo)' },
          limit: {
            type: 'number',
            description: 'Maximum number of rows to return (optional, defaults to 100)'
          },
          where: { type: 'string', description: 'WHERE clause conditions (optional)' }
        },
        required: ['table_name']
      }
    },
  • index.js:287-296 (registration)
    Registration and dispatch of get_table_data tool call to the DatabaseToolsHandler in the main MCP server switch statement
    case 'get_table_data':
      return {
        content: await this.databaseTools.getTableData(
          args.table_name,
          args.database,
          args.schema,
          args.limit,
          args.offset
        )
      };
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 only states basic functionality. It doesn't disclose behavioral traits like whether this is a read-only operation (implied but not stated), potential performance impact, authentication requirements, rate limits, or what 'sample data' means (e.g., random rows, first N rows).

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 and front-loaded with the core functionality.

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

Completeness2/5

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

For a data retrieval tool with 5 parameters and no annotations or output schema, the description is incomplete. It doesn't explain what 'sample data' means, the format of returned data, error conditions, or how it differs from similar tools like execute_query, leaving significant gaps for an AI agent.

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 schema already documents all 5 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optional filtering and limiting' (hinting at where and limit parameters) but doesn't provide additional semantic context or usage examples.

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 ('Get sample data') and resource ('from a table'), distinguishing it from siblings like describe_table or list_tables. However, it doesn't explicitly differentiate from execute_query, which might also retrieve data with more complex queries.

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 mentions 'optional filtering and limiting' but provides no guidance on when to use this tool versus alternatives like execute_query for more complex queries or export_table_csv for data export. No explicit when/when-not instructions are given.

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/egarcia74/warp-sql-server-mcp'

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