Skip to main content
Glama

Bind a block to a datasource/query

bind_block_query

Bind a block to an existing query or datasource to populate its query results. Auto-creates a SELECT * query from a datasource ID while preserving HTML, CSS, and name.

Instructions

Give an existing block its data binding so currentBlock.queryResults[0] is populated. Pass an existing query_id, OR a datasource_id (a SELECT * query is auto-created against it and linked). Sets the block's ui_queries while preserving its html/css/name. The bound query must have a datasource (auto-created ones do) or the portal rejects it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sqlNoOptional raw SQL for the auto-created query (use alias `datasource` as the table). Only with datasource_id; default is SELECT *.
dry_runNoPreview the binding without writing (with datasource_id, the SELECT * query is NOT created either).
block_idYesBlock UUID to bind.
query_idNoExisting saved query UUID. Mutually exclusive with datasource_id.
page_sizeNoRows fetched into queryResults. Omit for the default null = ALL rows (preferred — the block sees the full dataset). Set a positive number only to cap intentionally (e.g. a small preview); a low cap truncates the data the block sees.
datasource_idNoDatasource UUID — auto-creates a SELECT * query against it. Mutually exclusive with query_id.
Behavior4/5

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

Annotations indicate readOnlyHint=false, destructiveHint=false, and idempotentHint=false, but the description adds valuable behavioral context: it explains that binding populates queryResults, preserves html/css/name, and that auto-created queries are linked. It also discloses the rejection condition (missing datasource) and the dry_run behavior. This goes beyond the annotations, though it doesn't detail side effects like whether existing ui_queries are overwritten or how the portal handles failures.

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: it opens with the core purpose, then explains the two binding modes, and ends with a critical constraint. Every sentence adds information without redundancy. The parameter details are left to the schema, keeping the description focused.

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

Completeness4/5

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

Given the tool's complexity (6 parameters, two mutually exclusive modes, auto-creation behavior, and a rejection condition), the description covers the essential usage scenarios. It doesn't explicitly state what happens to existing ui_queries or how the response looks, but since there's no output schema and the tool is a mutation, the description provides enough for an agent to call it correctly. The missing details are minor and could be inferred from the schema.

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 the schema already documents all parameters. The description adds value by clarifying the relationship between query_id and datasource_id (mutually exclusive), explaining the default behavior of page_size (null = ALL rows, preferred) and the implications of setting a cap, and noting that sql is only used with datasource_id. This enriches the schema's basic 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 the tool's purpose: 'Give an existing block its data binding so currentBlock.queryResults[0] is populated.' It specifies the resource (block) and the action (bind to a datasource/query), and distinguishes it from siblings like create_block and update_block by focusing on data binding rather than block creation or general updates.

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?

The description provides explicit usage guidance: it explains the two mutually exclusive options (query_id vs datasource_id), notes that datasource_id auto-creates a SELECT * query, and warns that the bound query must have a datasource or the portal rejects it. It also mentions the dry_run option for previewing without writing, which helps agents decide when to use it.

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/zuarbase/Zuar-Portal-MCP-Public'

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