Skip to main content
Glama
sql-mcp
by ohankay

get_object_definition

Read-onlyIdempotent

Retrieve full T-SQL source code for stored procedures, views, functions, or triggers from SQL Server, returning complete definitions beyond sp_helptext output.

Instructions

Return the T-SQL source of a procedure, view, function or trigger (like sp_helptext, but complete).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "get_object_definition"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
databaseNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is fully covered structurally. The description's only added behavioral signal is 'complete' (source is not truncated like sp_helptext), which is useful but thin — nothing about what happens with an unqualified name, a name that doesn't exist, or how connection selection affects resolution.

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?

A single front-loaded sentence with no filler; the verb and resource lead, and the analogy lands at the end where it aids recall rather than delaying the point.

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

Completeness3/5

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

With three parameters at 0% description coverage, no output schema, and no disambiguation from nearby metadata tools, the definition is too thin for the tool's lookup semantics. An agent knows what it returns but not how the database/connection parameters alter which object resolves, nor what an error looks like for a missing object.

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

Parameters2/5

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

Schema description coverage is 0%, so the description carries the full burden for all three parameters and adds nothing: neither 'name' (schema-qualified?), 'database' (defaults to current database when null?) nor 'connection' (which of the saved connections is used?) is explained anywhere. The agent must guess at resolution behavior from bare titles and null defaults.

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?

States a specific verb ('Return') and resource ('T-SQL source') and enumerates the object types covered: procedure, view, function, trigger. The sp_helptext analogy plus 'but complete' sharpens the intent, though it never explicitly distinguishes itself from siblings such as describe_table or list_objects.

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

Usage Guidelines3/5

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

Usage is only implied: an agent must infer it should call this when it needs the full source text rather than a structural summary. There are no exclusion conditions and no named alternatives (e.g. describe_table for column metadata), even though the sibling list contains plausible confusion candidates.

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