Skip to main content
Glama
elekto-com-br

Elekto MCP for SQL Server

Official

View definition

get_view_definition
Read-onlyIdempotent

Retrieve the CREATE VIEW SQL and columns for a database view to understand how it derives data. Returns definition null and definition_visible false if the login cannot read it.

Instructions

Returns the CREATE VIEW text of one view together with its columns, in the same detail as get_table_schema. Use it to see how a view derives its data; for the objects it reads from use get_dependency_graph. A view the login can see but not read comes back with definition null and definition_visible false, which check_permissions explains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
viewYesView name, bare, with no schema prefix.
schemaNoView schema. Empty searches every schema. Example: 'Feeder'
databaseYesName of the database as registered in the configuration.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations cover safety (readOnly, idempotent, non-destructive), so the bar is lower, and the description adds genuinely useful behavior beyond annotations: the null-definition/definition_visible=false case for unreadable views and the pointer to check_permissions. It does not cover existence errors or output shape details, but the access-edge behavior is a substantive addition.

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?

Three sentences, front-loaded with the return value, then usage, then the edge case. No filler or repetition.

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?

For a read-only tool with exhaustive annotations, full schema coverage, and no output schema needed for an access-edge case, the description covers purpose, sibling routing, upstream-navigation pointer, and the permission edge case. Nothing an agent needs to call it correctly is missing.

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 documents the parameters (view, schema, database) including formats and defaults. The description adds nothing parameter-specific, so baseline 3 applies.

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?

States a precise verb+resource: returns the CREATE VIEW text plus columns. It explicitly positions itself against get_table_schema (same detail level) and get_dependency_graph (for source objects), which are the natural alternatives in this sibling set.

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?

Clear context for use: see how a view derives data, and a routing hint to get_dependency_graph for upstream objects. It does not state exclusions (e.g., that it errors if the view does not exist) nor explicitly contrast with list_views, but the intended usage context is well established.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.