Skip to main content
Glama
croc100

litescope

Run a read-only query

litescope_query
Read-onlyIdempotent

Execute read-only SQL queries on SQLite, Cloudflare D1, or Turso databases and retrieve results as JSON. Control output with column projection and row limits to manage context.

Instructions

Run a read-only SQL query on any SQLite or D1 database and return the results as JSON. Only SELECT statements and read-only PRAGMAs are allowed. This is the primary tool for an AI agent to explore data in a D1 database.

Token budgeting: results are capped at max_rows (default 200) so a large table won't blow your context window — the response reports total_rows and truncated. Use the columns argument to project only the fields you need. Narrow with LIMIT / WHERE for precise reads.

For D1: set CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID and use source=d1://DB_ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlYesA read-only SQL query (SELECT or read-only PRAGMA). Mutations are rejected.
sourceYesDatabase source: a local file path (./app.db), a Cloudflare D1 DSN (d1://DB_ID when CLOUDFLARE_API_TOKEN+CLOUDFLARE_ACCOUNT_ID are set, or d1://TOKEN@ACCOUNT_ID/DB_ID), or a Turso DSN (turso://TOKEN@ORG/DB).
columnsNoOptional: keep only these columns in each row (projection) to save context.
max_rowsNoMaximum rows to return (default 200, max 2000). Excess rows are dropped and reported via truncated.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
rowsYesThe result rows.
countYesRows returned after truncation.
truncatedYesTrue when total_rows exceeded max_rows.
total_rowsYesRows the query produced before truncation.
Behavior4/5

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

Annotations already indicate readOnlyHint, idempotentHint, and destructiveHint. The description adds useful behavioral details beyond annotations: results are capped at max_rows (default 200, max 2000), the response reports total_rows and truncated, and mutations are rejected. This provides context for AI agents.

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 concise and well-structured. The first sentence immediately states the purpose, followed by clear paragraphs on constraints, token budgeting, and setup. Every sentence adds value without redundancy.

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 the complexity (4 parameters, output schema exists), the description is complete. It covers all aspects needed for correct invocation: query restrictions, row limits, projection, source configuration, and default behavior. No gaps are apparent.

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

Parameters4/5

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

Schema description coverage is 100%, so baseline is 3. The description adds meaningful context: explains the default and max for max_rows, the projection benefit of columns, and clarifies source format with examples (local, D1, Turso). This goes beyond the schema's descriptions.

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?

The description clearly states it runs a read-only SQL query on SQLite or D1 databases returning JSON. It specifies only SELECT and read-only PRAGMAs are allowed, distinguishing it from sibling tools like litescope_schema or litescope_health by being the primary data exploration tool.

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

Usage Guidelines4/5

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

The description provides clear context on when to use the tool (exploring data) and gives practical guidance on token budgeting, row limits, column projection, and narrowing queries. However, it does not explicitly exclude scenarios or mention alternative sibling tools for different tasks.

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/croc100/Litescope'

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