Skip to main content
Glama

query_sql

Destructive

Execute SQL queries (SELECT, UPDATE, DELETE, INSERT) on SeaTable tables with parameterized placeholders. Use backticks for names with spaces, implicit joins, ILIKE for case-insensitive matching, and special operators for multi-select columns. Returns up to 100 rows by default; use LIMIT for more.

Instructions

Execute SQL queries against SeaTable (SELECT, UPDATE, DELETE, INSERT). Use ? placeholders for parameters.

Syntax rules:

  • Quote table/column names with backticks: Table Name, Column Name (not double quotes). Required for names with spaces, hyphens, or names matching function names.

  • SELECT returns max 100 rows by default. Use LIMIT to get more (up to 10,000).

  • Aliases (AS) can be used in GROUP BY, HAVING, ORDER BY — but NOT in WHERE.

  • ORDER BY columns must appear in the SELECT field list.

  • No JOIN keyword. Use implicit joins: FROM T1, T2 WHERE T1.col = T2.col. Only inner joins are supported.

  • No subqueries, no UNION/UNION ALL.

  • Empty strings are treated as NULL. Use IS NULL / IS NOT NULL instead of = "".

  • Use ILIKE for case-insensitive matching (LIKE is case-sensitive).

  • For multi-select/collaborator columns use: HAS ANY OF, HAS ALL OF, HAS NONE OF, IS EXACTLY (values in parentheses like IN).

UPDATE limitations:

  • SET only accepts literal values (strings, numbers, booleans). No functions (date(), now(), upper()…) and no expressions (Amount + 10) allowed.

  • Columns not updatable via SQL: image, file, formula, link, link-formula, geolocation, auto-number, digital-sign, button.

INSERT only works with Big Data storage enabled (Enterprise). For non-archived tables, use append_rows instead.

If a query fails, do not retry with similar syntax. Switch to an alternative tool (e.g. update_rows, find_rows) instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesSQL query (SELECT, INSERT, UPDATE, DELETE)
parametersNoValues for ? placeholders in the SQL query
Behavior5/5

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

Annotations already indicate destructiveHint=true, and description transparently details behavioral traits: UPDATE limitations (no functions/expressions), empty strings treated as NULL, lack of JOIN keyword and subqueries, and row limits with max 100 default, up to 10,000 with LIMIT.

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

Conciseness4/5

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

Well-structured with clear sections and examples, but slightly verbose; some rules could be consolidated. Front-loaded with essential purpose and placeholder syntax.

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

Completeness5/5

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

Given complexity of tool (SQL queries with many constraints) and lack of output schema, description is remarkably complete: covers syntax rules, limitations for UPDATE/INSERT, failure handling, and even alternative tools.

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

Parameters5/5

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

Schema has 100% coverage (sql string and parameters array), but description adds significant meaning beyond schema: explains ? placeholders, syntax rules for backticks, clauses where aliases work/not work, and parameter types implied in schema.

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

Purpose5/5

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

Description explicitly states it executes SQL queries (SELECT, UPDATE, DELETE, INSERT) against SeaTable, clearly distinguishing it from sibling tools like find_rows or list_rows that use alternative query methods.

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

Usage Guidelines5/5

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

Provides extensive when-to-use and when-not-to-use guidance: details syntax rules, INSERT limitations (requires Big Data storage, suggests append_rows as alternative), and explicit instruction to switch to alternative tools (update_rows, find_rows) on failure.

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/seatable/seatable-mcp'

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