Skip to main content
Glama
thousandmiles

Semantic Code MCP Server

search_in_file

Find the exact line and character position of a string within a file to locate code definitions and enable semantic analysis.

Instructions

Search for a string in a file to find its line and character position. Useful for finding the arguments for get_definition.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe string to search for
filePathYesThe absolute path to the file to search in

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4/5.0
Behavior3/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 accurately describes a text search that returns line and character position, but it does not disclose whether it returns the first match, all matches, how missing strings are handled, or whether positions are zero-based. This leaves some ambiguity but is not misleading.

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?

Two short sentences with no wasted words. The core action and result are front-loaded, and the useful connection to get_definition is appended efficiently.

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?

For a simple two-parameter tool, the description conveys the purpose, the result type, and a primary use case. It lacks a few details such as match cardinality and output format, but it is sufficient for an agent to invoke it correctly in the intended workflow.

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 both filePath and query are already documented in the schema. The description adds no extra parameter-level detail, so the baseline of 3 is appropriate.

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 action ('Search for a string in a file') and a concrete outcome ('to find its line and character position'). This clearly identifies the tool's function and differentiates it from semantic siblings like get_definition and get_references by framing it as a raw text-position search used to prepare arguments for get_definition.

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?

The description gives an explicit use case: 'Useful for finding the arguments for get_definition.' This tells the agent when to reach for this tool, but it does not explicitly mention when not to use it or compare it to get_references or check_function_call.

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

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/thousandmiles/lsp-mcp-server'

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