Skip to main content
Glama

Get Code Context

get-code-context
Read-onlyIdempotent

Reads source code around a selected location or span, returning resolved location, surrounding text, enclosing symbols, and diagnostics to inspect search results or compiler errors in context.

Instructions

Reads source around a location, returning the resolved location, text, enclosingSymbols and diagnostics. Use this to inspect a search result or diagnostic in context; use get-symbol-info for symbol details or get-diagnostics for broader diagnostic analysis. Includes all lines touched by the selection plus 10 lines before and after by default; beforeLines and afterLines each accept 0 to 100 and are clipped at document boundaries. Enclosing symbols and compiler diagnostics are opt-in via includeEnclosingSymbols and includeDiagnostics, both false by default. Diagnostics cover the selected span, not the expanded text window or project analysers. Limits default to 16 enclosing symbols and 50 diagnostics; check each collection.hasMore. Reads the loaded workspace without modifying source.

Input Schema

NameRequiredDescriptionDefault
locationYesThe location selector.
workspaceNoProvide workspaceId, alias, path, or any combination.
afterLinesNoThe optional number of lines to include after the selected location.
beforeLinesNoThe optional number of lines to include before the selected location.
diagnosticsLimitNoMaximum number of diagnostics to return.
expectedSnapshotNoEcho the snapshot returned with the data or transaction state used to construct this request.
includeDiagnosticsNoWhether diagnostics should be included for the selected span.
enclosingSymbolsLimitNoMaximum number of enclosing symbols to return.
includeEnclosingSymbolsNoWhether the enclosing symbol chain should be included.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.0.5
    • addedInput schema / $defs
      Added value: +{
      +  "document": {
      +    "properties": {
      +      "documentId": {
      +        "description": "Workspace-local document ID.",
      +        "type": "string"
      +      },
      +      "path": {
      +        "description": "Workspace-relative path.",
      +        "type": "string"
      +      },
      +      "project": {
      +        "description": "Disambiguates documents with matching paths or IDs.",
      +        "properties": {
      +          "name": {
      +            "type": "string"
      +          },
      +          "path": {
      +            "description": "Workspace-relative path.",
      +            "type": "string"
      +          },
      +          "projectId": {
      +            "type": "string"
      +          },
      +          "targetFramework": {
      +            "type": "string"
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  }
      +}
    • addedInput schema / properties / location / properties / selection / properties / document / $ref
      Added value: +"#/$defs/document"
    • removedInput schema / properties / location / properties / selection / properties / document / properties
      Removed value: -{
      -  "documentId": {
      -    "description": "Workspace-local document ID.",
      -    "type": "string"
      -  },
      -  "path": {
      -    "description": "Workspace-relative path.",
      -    "type": "string"
      -  },
      -  "project": {
      -    "$ref": "#/properties/location/properties/span/properties/document/properties/project",
      -    "description": "Disambiguates documents with matching paths or IDs."
      -  }
      -}
    • removedInput schema / properties / location / properties / selection / properties / document / type
      Removed value: -"object"
    • addedInput schema / properties / location / properties / span / properties / document / $ref
      Added value: +"#/$defs/document"
    • removedInput schema / properties / location / properties / span / properties / document / properties
      Removed value: -{
      -  "documentId": {
      -    "description": "Workspace-local document ID.",
      -    "type": "string"
      -  },
      -  "path": {
      -    "description": "Workspace-relative path.",
      -    "type": "string"
      -  },
      -  "project": {
      -    "description": "Disambiguates documents with matching paths or IDs.",
      -    "properties": {
      -      "name": {
      -        "type": "string"
      -      },
      -      "path": {
      -        "description": "Workspace-relative path.",
      -        "type": "string"
      -      },
      -      "projectId": {
      -        "type": "string"
      -      },
      -      "targetFramework": {
      -        "type": "string"
      -      }
      -    },
      -    "type": [
      -      "object",
      -      "null"
      -    ]
      -  }
      -}
    • removedInput schema / properties / location / properties / span / properties / document / type
      Removed value: -"object"
  2. Changed1 schema field changedv1.0.4
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "warningInfo": {
      +      "properties": {
      +        "code": {
      +          "description": "The stable machine-readable warning code.",
      +          "type": "string"
      +        },
      +        "message": {
      +          "description": "The human-readable warning message.",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "code",
      +        "message"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "oneOf": [
      +    {
      +      "properties": {
      +        "data": {
      +          "description": "Tool-specific result payload.",
      +          "properties": {
      +            "diagnostics": {
      +              "description": "The diagnostics projected for the selected location.",
      +              "properties": {
      +                "hasMore": {
      +                  "description": "Whether additional items were available beyond this page.",
      +                  "type": "boolean"
      +                },
      +                "items": {
      +                  "description": "Items returned in this page.",
      +                  "items": {
      +                    "properties": {
      +                      "id": {
      +                        "description": "The diagnostic identifier.",
      +                        "type": "string"
      +                      },
      +                      "location": {
      +                        "description": "The optional source location of the diagnostic.",
      +                        "properties": {
      +                          "column": {
      +                            "description": "The one-based column number.",
      +                            "type": "integer"
      +                          },
      +                          "document": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/document",
      +                            "description": "The resolved document."
      +                          },
      +                          "line": {
      +                            "description": "The one-based line number.",
      +                            "type": "integer"
      +                          },
      +                          "selector": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/selector",
      +                            "description": "The canonical selector that can resolve this source location again."
      +                          },
      +                          "snapshot": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/snapshot",
      +                            "description": "The exact immutable workspace snapshot associated with this location."
      +                          },
      +                          "span": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/span",
      +                            "description": "The resolved text span."
      +                          }
      +                        },
      +                        "required": [
      +                          "snapshot"
      +                        ],
      +                        "type": [
      +                          "object",
      +                          "null"
      +                        ]
      +                      },
      +                      "message": {
      +                        "description": "The diagnostic message.",
      +                        "type": "string"
      +                      },
      +                      "severity": {
      +                        "description": "The diagnostic severity.",
      +                        "enum": [
      +                          "Hidden",
      +                          "Info",
      +                          "Warning",
      +                          "Error"
      +                        ],
      +                        "type": "string"
      +                      }
      +                    },
      +                    "required": [
      +                      "id",
      +                      "message"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": [
      +                    "array",
      +                    "null"
      +                  ]
      +                },
      +                "totalCount": {
      +                  "description": "Complete result count, when available without additional expensive work.",
      +                  "type": [
      +                    "integer",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "enclosingSymbols": {
      +              "description": "The enclosing symbol chain from the innermost symbol outward.",
      +              "properties": {
      +                "hasMore": {
      +                  "description": "Whether additional items were available beyond this page.",
      +                  "type": "boolean"
      +                },
      +                "items": {
      +                  "description": "Items returned in this page.",
      +                  "items": {
      +                    "properties": {
      +                      "displayName": {
      +                        "description": "The display name of the symbol.",
      +                        "type": "string"
      +                      },
      +                      "documentationCommentId": {
      +                        "description": "The documentation comment identifier, when available.",
      +                        "type": [
      +                          "string",
      +                          "null"
      +                        ]
      +                      },
      +                      "kind": {
      +                        "description": "The symbol kind.",
      +                        "type": "string"
      +                      },
      +                      "location": {
      +                        "description": "The optional source location of the symbol.",
      +                        "properties": {
      +                          "column": {
      +                            "description": "The one-based column number.",
      +                            "type": "integer"
      +                          },
      +                          "document": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/document",
      +                            "description": "The resolved document."
      +                          },
      +                          "line": {
      +                            "description": "The one-based line number.",
      +                            "type": "integer"
      +                          },
      +                          "selector": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/selector",
      +                            "description": "The canonical selector that can resolve this source location again."
      +                          },
      +                          "snapshot": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/snapshot",
      +                            "description": "The exact immutable workspace snapshot associated with this location."
      +                          },
      +                          "span": {
      +                            "$ref": "#/properties/request/properties/value/properties/location/properties/span",
      +                            "description": "The resolved text span."
      +                          }
      +                        },
      +                        "required": [
      +                          "snapshot"
      +                        ],
      +                        "type": [
      +                          "object",
      +                          "null"
      +                        ]
      +                      }
      +                    },
      +                    "required": [
      +                      "displayName",
      +                      "kind"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "type": [
      +                    "array",
      +                    "null"
      +                  ]
      +                },
      +                "totalCount": {
      +                  "description": "Complete result count, when available without additional expensive work.",
      +                  "type": [
      +                    "integer",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "location": {
      +              "description": "The resolved source location.",
      +              "properties": {
      +                "column": {
      +                  "description": "The one-based column number.",
      +                  "type": "integer"
      +                },
      +                "document": {
      +                  "description": "The resolved document.",
      +                  "properties": {
      +                    "documentId": {
      +                      "description": "The document identifier.",
      +                      "type": "string"
      +                    },
      +                    "path": {
      +                      "description": "The normalized document path.",
      +                      "type": "string"
      +                    },
      +                    "projectId": {
      +                      "description": "The owning project identifier.",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "documentId",
      +                    "path",
      +                    "projectId"
      +                  ],
      +                  "type": [
      +                    "object",
      +                    "null"
      +                  ]
      +                },
      +                "line": {
      +                  "description": "The one-based line number.",
      +                  "type": "integer"
      +                },
      +                "selector": {
      +                  "description": "The canonical selector that can resolve this source location again.",
      +                  "properties": {
      +                    "span": {
      +                      "properties": {
      +                        "document": {
      +                          "description": "Provide exactly one of path or documentId.",
      +                          "properties": {
      +                            "documentId": {
      +                              "description": "Workspace-local document ID.",
      +                              "type": [
      +                                "string",
      +                                "null"
      +                              ]
      +                            },
      +                            "path": {
      +                              "description": "Workspace-relative path.",
      +                              "type": [
      +                                "string",
      +                                "null"
      +                              ]
      +                            },
      +                            "project": {
      +                              "description": "Disambiguates documents with matching paths or IDs.",
      +                              "properties": {
      +                                "name": {
      +                                  "type": [
      +                                    "string",
      +                                    "null"
      +                                  ]
      +                                },
      +                                "path": {
      +                                  "description": "Workspace-relative path.",
      +                                  "type": [
      +                                    "string",
      +                                    "null"
      +                                  ]
      +                                },
      +                                "projectId": {
      +                                  "type": [
      +                                    "string",
      +                                    "null"
      +                                  ]
      +                                },
      +                                "targetFramework": {
      +                                  "type": [
      +                                    "string",
      +                                    "null"
      +                                  ]
      +                                }
      +                              },
      +                              "type": [
      +                                "object",
      +                                "null"
      +                              ]
      +                            }
      +                          },
      +                          "type": "object"
      +                        },
      +                        "range": {
      +                          "description": "Zero-based UTF-16 range.",
      +                          "properties": {
      +                            "length": {
      +                              "description": "UTF-16 code-unit length.",
      +                              "maximum": 2147483647,
      +                              "minimum": 0,
      +                              "type": "integer"
      +                            },
      +                            "start": {
      +                              "description": "Zero-based UTF-16 offset.",
      +                              "maximum": 2147483647,
      +                              "minimum": 0,
      +                              "type": "integer"
      +                            }
      +                          },
      +                          "type": "object"
      +                        }
      +                      },
      +                      "required": [
      +                        "document",
      +                        "range"
      +                      ],
      +                      "type": "object"
      +                    }
      +                  },
      +                  "required": [
      +                    "span"
      +                  ],
      +                  "type": [
      +                    "object",
      +                    "null"
      +                  ]
      +                },
      +                "snapshot": {
      +                  "description": "The exact immutable workspace snapshot associated with this location.",
      +                  "properties": {
      +                    "snapshotId": {
      +                      "format": "uuid",
      +                      "type": "string"
      +                    },
      +                    "transactionRevision": {
      +                      "type": [
      +                        "integer",
      +                        "null"
      +                      ]
      +                    },
      +                    "workspaceEpoch": {
      +                      "type": "integer"
      +                    },
      +                    "workspaceId": {
      +                      "format": "uuid",
      +                      "type": "string"
      +                    }
      +                  },
      +                  "required": [
      +                    "workspaceId",
      +                    "workspaceEpoch",
      +                    "snapshotId",
      +                    "transactionRevision"
      +                  ],
      +                  "type": "object"
      +                },
      +                "span": {
      +                  "description": "The resolved text span.",
      +                  "properties": {
      +                    "length": {
      +                      "description": "UTF-16 code-unit length.",
      +                      "maximum": 2147483647,
      +                      "minimum": 0,
      +                      "type": "integer"
      +                    },
      +                    "start": {
      +                      "description": "Zero-based UTF-16 offset.",
      +                      "maximum": 2147483647,
      +                      "minimum": 0,
      +                      "type": "integer"
      +                    }
      +                  },
      +                  "type": [
      +                    "object",
      +                    "null"
      +                  ]
      +                }
      +              },
      +              "required": [
      +                "snapshot"
      +              ],
      +              "type": [
      +                "object",
      +                "null"
      +              ]
      +            },
      +            "text": {
      +              "description": "The bounded source text.",
      +              "type": "string"
      +            }
      +          },
      +          "type": [
      +            "object",
      +            "null"
      +          ]
      +        },
      +        "ok": {
      +          "const": true,
      +          "description": "Whether the tool invocation succeeded."
      +        },
      +        "snapshot": {
      +          "description": "Exact immutable workspace snapshot associated with the result, when available.",
      +          "properties": {
      +            "snapshotId": {
      +              "format": "uuid",
      +              "type": "string"
      +            },
      +            "transactionRevision": {
      +              "type": [
      +                "integer",
      +                "null"
      +              ]
      +            },
      +            "workspaceEpoch": {
      +              "type": "integer"
      +            },
      +            "workspaceId": {
      +              "format": "uuid",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "workspaceId",
      +            "workspaceEpoch",
      +            "snapshotId",
      +            "transactionRevision"
      +          ],
      +          "type": "object"
      +        },
      +        "warnings": {
      +          "description": "Non-fatal warnings the agent should consider.",
      +          "items": {
      +            "$ref": "#/$defs/warningInfo"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "data",
      +        "snapshot"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "continuation": {
      +          "description": "Action the agent should take before retrying or continuing.",
      +          "oneOf": [
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "instruction": {
      +                  "description": "Agent-facing instruction explaining how to continue.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "const": "CallTool",
      +                  "description": "Action required before the original request can continue."
      +                },
      +                "tool": {
      +                  "description": "Tool to call before continuing the original request.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "tool",
      +                "instruction"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "instruction": {
      +                  "description": "Agent-facing instruction explaining how to continue.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "const": "ChooseTool",
      +                  "description": "Action required before the original request can continue."
      +                },
      +                "tools": {
      +                  "description": "Allowed tool choices from which the agent must select one.",
      +                  "items": {
      +                    "description": "Name of a tool the agent may choose.",
      +                    "minLength": 1,
      +                    "type": "string"
      +                  },
      +                  "minItems": 1,
      +                  "type": "array",
      +                  "uniqueItems": true
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "tools",
      +                "instruction"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "instruction": {
      +                  "description": "Agent-facing instruction explaining how to continue.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "const": "RetryRequest",
      +                  "description": "Action required before the original request can continue."
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "instruction"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "instruction": {
      +                  "description": "Agent-facing instruction explaining how to continue.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "const": "ReviseRequest",
      +                  "description": "Action required before the original request can continue."
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "instruction"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "properties": {
      +                "instruction": {
      +                  "description": "Agent-facing instruction explaining how to continue.",
      +                  "minLength": 1,
      +                  "type": "string"
      +                },
      +                "kind": {
      +                  "const": "ResolveExternally",
      +                  "description": "Action required before the original request can continue."
      +                }
      +              },
      +              "required": [
      +                "kind",
      +                "instruction"
      +              ],
      +              "type": "object"
      +            }
      +          ]
      +        },
      +        "diagnostics": {
      +          "description": "Diagnostics that explain the failed invocation.",
      +          "items": {
      +            "properties": {
      +              "id": {
      +                "description": "The diagnostic identifier.",
      +                "type": "string"
      +              },
      +              "location": {
      +                "description": "The optional source location of the diagnostic.",
      +                "properties": {
      +                  "column": {
      +                    "description": "The one-based column number.",
      +                    "type": "integer"
      +                  },
      +                  "document": {
      +                    "description": "The resolved document.",
      +                    "properties": {
      +                      "documentId": {
      +                        "description": "The document identifier.",
      +                        "type": "string"
      +                      },
      +                      "path": {
      +                        "description": "The normalized document path.",
      +                        "type": "string"
      +                      },
      +                      "projectId": {
      +                        "description": "The owning project identifier.",
      +                        "type": "string"
      +                      }
      +                    },
      +                    "required": [
      +                      "documentId",
      +                      "path",
      +                      "projectId"
      +                    ],
      +                    "type": [
      +                      "object",
      +                      "null"
      +                    ]
      +                  },
      +                  "line": {
      +                    "description": "The one-based line number.",
      +                    "type": "integer"
      +                  },
      +                  "selector": {
      +                    "description": "The canonical selector that can resolve this source location again.",
      +                    "properties": {
      +                      "span": {
      +                        "properties": {
      +                          "document": {
      +                            "description": "Provide exactly one of path or documentId.",
      +                            "properties": {
      +                              "documentId": {
      +                                "description": "Workspace-local document ID.",
      +                                "type": [
      +                                  "string",
      +                                  "null"
      +                                ]
      +                              },
      +                              "path": {
      +                                "description": "Workspace-relative path.",
      +                                "type": [
      +                                  "string",
      +                                  "null"
      +                                ]
      +                              },
      +                              "project": {
      +                                "description": "Disambiguates documents with matching paths or IDs.",
      +                                "properties": {
      +                                  "name": {
      +                                    "type": [
      +                                      "string",
      +                                      "null"
      +                                    ]
      +                                  },
      +                                  "path": {
      +                                    "description": "Workspace-relative path.",
      +                                    "type": [
      +                                      "string",
      +                                      "null"
      +                                    ]
      +                                  },
      +                                  "projectId": {
      +                                    "type": [
      +                                      "string",
      +                                      "null"
      +                                    ]
      +                                  },
      +                                  "targetFramework": {
      +                                    "type": [
      +                                      "string",
      +                                      "null"
      +                                    ]
      +                                  }
      +                                },
      +                                "type": [
      +                                  "object",
      +                                  "null"
      +                                ]
      +                              }
      +                            },
      +                            "type": "object"
      +                          },
      +                          "range": {
      +                            "description": "Zero-based UTF-16 range.",
      +                            "properties": {
      +                              "length": {
      +                                "description": "UTF-16 code-unit length.",
      +                                "maximum": 2147483647,
      +                                "minimum": 0,
      +                                "type": "integer"
      +                              },
      +                              "start": {
      +                                "description": "Zero-based UTF-16 offset.",
      +                                "maximum": 2147483647,
      +                                "minimum": 0,
      +                                "type": "integer"
      +                              }
      +                            },
      +                            "type": "object"
      +                          }
      +                        },
      +                        "required": [
      +                          "document",
      +                          "range"
      +                        ],
      +                        "type": "object"
      +                      }
      +                    },
      +                    "required": [
      +                      "span"
      +                    ],
      +                    "type": [
      +                      "object",
      +                      "null"
      +                    ]
      +                  },
      +                  "snapshot": {
      +                    "description": "The exact immutable workspace snapshot associated with this location.",
      +                    "properties": {
      +                      "snapshotId": {
      +                        "format": "uuid",
      +                        "type": "string"
      +                      },
      +                      "transactionRevision": {
      +                        "type": [
      +                          "integer",
      +                          "null"
      +                        ]
      +                      },
      +                      "workspaceEpoch": {
      +                        "type": "integer"
      +                      },
      +                      "workspaceId": {
      +                        "format": "uuid",
      +                        "type": "string"
      +                      }
      +                    },
      +                    "required": [
      +                      "workspaceId",
      +                      "workspaceEpoch",
      +                      "snapshotId",
      +                      "transactionRevision"
      +                    ],
      +                    "type": "object"
      +                  },
      +                  "span": {
      +                    "description": "The resolved text span.",
      +                    "properties": {
      +                      "length": {
      +                        "description": "UTF-16 code-unit length.",
      +                        "maximum": 2147483647,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      },
      +                      "start": {
      +                        "description": "Zero-based UTF-16 offset.",
      +                        "maximum": 2147483647,
      +                        "minimum": 0,
      +                        "type": "integer"
      +                      }
      +                    },
      +                    "type": [
      +                      "object",
      +                      "null"
      +                    ]
      +                  }
      +                },
      +                "required": [
      +                  "snapshot"
      +                ],
      +                "type": [
      +                  "object",
      +                  "null"
      +                ]
      +              },
      +              "message": {
      +                "description": "The diagnostic message.",
      +                "type": "string"
      +              },
      +              "severity": {
      +                "description": "The diagnostic severity.",
      +                "enum": [
      +                  "Hidden",
      +                  "Info",
      +                  "Warning",
      +                  "Error"
      +                ],
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "message"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "error": {
      +          "description": "Structured error details when the invocation failed.",
      +          "properties": {
      +            "code": {
      +              "description": "Stable machine-readable error code.",
      +              "type": "string"
      +            },
      +            "correlationId": {
      +              "description": "Correlation identifier for matching the failure to server-side diagnostics, when available.",
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "message": {
      +              "description": "Human-readable explanation of the failure.",
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "message"
      +          ],
      +          "type": "object"
      +        },
      +        "ok": {
      +          "const": false,
      +          "description": "Whether the tool invocation succeeded."
      +        },
      +        "warnings": {
      +          "description": "Non-fatal warnings the agent should consider.",
      +          "items": {
      +            "$ref": "#/$defs/warningInfo"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "error"
      +      ],
      +      "type": "object"
      +    },
      +    {
      +      "properties": {
      +        "diagnostics": {
      +          "description": "Diagnostics that explain the failed invocation.",
      +          "properties": {
      +            "detailsAvailable": {
      +              "const": true
      +            },
      +            "detailsTool": {
      +              "const": "get-error-details"
      +            }
      +          },
      +          "required": [
      +            "detailsAvailable",
      +            "detailsTool"
      +          ],
      +          "type": "object"
      +        },
      +        "error": {
      +          "description": "Structured error details when the invocation failed.",
      +          "properties": {
      +            "code": {
      +              "const": "UnhandledException"
      +            },
      +            "correlationId": {
      +              "format": "uuid",
      +              "type": "string"
      +            },
      +            "message": {
      +              "const": "Tool execution failed."
      +            }
      +          },
      +          "required": [
      +            "code",
      +            "message",
      +            "correlationId"
      +          ],
      +          "type": "object"
      +        },
      +        "ok": {
      +          "const": false,
      +          "description": "Whether the tool invocation succeeded."
      +        },
      +        "reporting": {
      +          "description": "Error-reporting workflow available for an unhandled failure.",
      +          "properties": {
      +            "canPrepare": {
      +              "type": "boolean"
      +            },
      +            "prepareTool": {
      +              "type": [
      +                "string",
      +                "null"
      +              ]
      +            },
      +            "state": {
      +              "enum": [
      +                "Available",
      +                "AlwaysApproved",
      +                "DisabledByConfiguration",
      +                "ApprovalUnavailable"
      +              ],
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "state"
      +          ],
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "ok",
      +        "error",
      +        "diagnostics"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  3. First observedv1.0.2

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, non-destructive behavior, and the description adds substantial operational detail beyond them. It explains the default 10-line window, 0-100 before/after line limits clipped at document boundaries, opt-in enclosing symbols and diagnostics, diagnostics scope limited to the selected span, per-collection limits with hasMore, and that source is not modified.

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 front-loaded with purpose and use guidance, then efficiently covers defaults, limits, opt-in behavior, and diagnostics scope. Every sentence adds operational value, and the slightly longer length is justified by the tool's nine parameters and many sibling alternatives.

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 tool's complexity, rich input schema, output schema, and annotations, the description is complete enough for an agent to invoke it correctly. It covers purpose, alternatives, key defaults, limits, scope boundaries, and read-only behavior without needing to repeat return-schema details.

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 coverage is 100%, so the schema already documents parameters well; the description still adds meaningful semantics about clipping at document boundaries, opt-in defaults for includeEnclosingSymbols and includeDiagnostics, diagnostics covering only the selected span, and checking collection.hasMore. It does not add much about workspace, expectedSnapshot, or the location selector, but those are covered by the schema.

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 states a specific verb and resource: it reads source around a location and returns resolved location, text, enclosingSymbols, and diagnostics. It also explicitly distinguishes itself from get-symbol-info and get-diagnostics, so an agent can tell which tool to select.

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?

It states exactly when to use this tool: to inspect a search result or diagnostic in context. It also names alternatives and their purposes, get-symbol-info for symbol details and get-diagnostics for broader diagnostic analysis.

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