Skip to main content
Glama

mcp_get_dependencies

Identify and retrieve all database object dependencies for tables, views, and stored procedures in SQL Server to analyze relationships and impact.

Instructions

Get dependencies for a database object (tables, views, stored procedures, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
object_nameYesFully qualified object name (schema.name), e.g. "api.Idiomas"

Implementation Reference

  • The handler function implementing the core logic of mcp_get_dependencies, querying sys.sql_expression_dependencies for object dependencies.
    export const mcp_get_dependencies = async (args: { object_name: string }): Promise<ToolResult<any[]>> => {
      const { object_name } = args;
      console.log('Executing mcp_get_dependencies with:', { object_name });
    
      try {
        const pool = getPool();
        const query = `
          SELECT 
              referenced_schema_name,
              referenced_entity_name,
              referenced_database_name,
              referenced_server_name
          FROM 
              sys.sql_expression_dependencies
          WHERE 
              referencing_id = OBJECT_ID(@object_name);
        `;
        const result = await pool.request()
          .input('object_name', object_name)
          .query(query);
    
        return { success: true, data: result.recordset };
      } catch (error: any) {
        console.error(`Error in mcp_get_dependencies for object ${object_name}:`, error);
        return { success: false, error: error.message };
      }
  • src/tools.ts:173-186 (registration)
    Tool registration in MCP_MSQL_TOOLS array, defining the tool name, description, and input schema validation.
    {
      name: "mcp_get_dependencies",
      description: "Get dependencies for a database object (tables, views, stored procedures, etc.)",
      inputSchema: {
        type: "object",
        properties: {
          object_name: {
            type: "string",
            description: "Fully qualified object name (schema.name), e.g. \"api.Idiomas\""
          }
        },
        required: ["object_name"]
      }
    },
  • Input schema definition for the mcp_get_dependencies tool.
    inputSchema: {
      type: "object",
      properties: {
        object_name: {
          type: "string",
          description: "Fully qualified object name (schema.name), e.g. \"api.Idiomas\""
        }
      },
      required: ["object_name"]
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the action ('Get dependencies') but lacks behavioral details such as permissions required, format of returned dependencies (e.g., list, graph), error handling, or rate limits. This is a significant gap for a tool with no annotation coverage.

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?

The description is a single, efficient sentence that front-loads the purpose without unnecessary details. It could be slightly improved by adding brief context, but it earns its place by being direct and clear.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete. It does not explain what 'dependencies' entail (e.g., foreign keys, references), the return format, or error cases. For a tool with one parameter but rich potential output complexity, more context is needed to guide the agent effectively.

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%, with the parameter 'object_name' fully documented in the schema. The description adds minimal value beyond the schema by implying the parameter is for a database object, but does not provide additional syntax, examples, or constraints. Baseline 3 is appropriate as the schema handles the heavy lifting.

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?

The description clearly states the verb ('Get') and resource ('dependencies for a database object'), specifying the types of objects (tables, views, stored procedures, etc.). It distinguishes from siblings like mcp_execute_query or mcp_preview_data by focusing on dependency retrieval, but does not explicitly differentiate from all siblings (e.g., mcp_sp_structure might be related).

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing object), exclusions, or compare to siblings like mcp_sp_structure or mcp_search_comprehensive, leaving the agent to infer usage context.

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/hendrickcastro/MCPQL'

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