Skip to main content
Glama
pavelpikta

lampa-mcp-server

Search Lampa source contents

search_code
Read-onlyIdempotent

Search Lampa source code for a literal or regex pattern and get path:line plus preview. Use when you need to locate a known symbol or pattern without listing files or reading full sources.

Instructions

Search Lampa source contents for a literal or regex and return path:line plus a preview. Use this when you know a symbol or pattern; do not use it to list files by name (find_files), dump catalogs (list_catalog), or read one known path (read_source). Defaults: literal, case-sensitive match (regex=true compiles RegExp exactly as written — no implicit i); extensions .js/.ts/.css/.scss/.html/.json unless globs is set. prefix narrows which folder is walked and globs still filters extensions within it — the two combine rather than override each other. Limits: 100 hits total, 5 per file, 200-char preview per line (fixed, to keep results small enough for one call); invalid regex → error naming the bad pattern; no matches → empty markdown, not an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
globsNoExtension globs to restrict search, e.g. ['*.js','*.ts']. When omitted, searches .js/.ts/.css/.scss/.html/.json.
queryYesLiteral substring (default, case-sensitive) or regex when regex=true.
regexNoIf true, compile query as a JS RegExp with no extra flags (no implicit case-insensitive). Default false (literal).
prefixNoRepo-relative folder to walk, e.g. 'src' or 'plugins/iptv'. Combines with globs (prefix walks, globs filter extensions).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
markdownYesHuman-readable markdown report. Always present, including empty-result cases. Does not write files.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.0
    • changedInput schema / properties / prefix / description
      Previous value: -"Repo-relative folder to walk, e.g. 'src' or 'plugins/iptv'. Preferred over globs when the area is known."New value: +"Repo-relative folder to walk, e.g. 'src' or 'plugins/iptv'. Combines with globs (prefix walks, globs filter extensions)."
  2. Changed4 schema fields changedv1.7.0
    • changedInput schema / properties / globs / description
      Previous value: -"File glob patterns to restrict search, e.g. ['*.js','*.ts']."New value: +"Extension globs to restrict search, e.g. ['*.js','*.ts']. When omitted, searches .js/.ts/.css/.scss/.html/.json."
    • changedInput schema / properties / prefix / description
      Previous value: -"Repo-relative folder to search within, e.g. 'src' or 'plugins/iptv'."New value: +"Repo-relative folder to walk, e.g. 'src' or 'plugins/iptv'. Preferred over globs when the area is known."
    • changedInput schema / properties / query / description
      Previous value: -"Text or regex to search for in file contents."New value: +"Literal substring (default, case-sensitive) or regex when regex=true."
    • changedInput schema / properties / regex / description
      Previous value: -"Treat query as a regex. Default false (literal)."New value: +"If true, compile query as a JS RegExp with no extra flags (no implicit case-insensitive). Default false (literal)."
  3. Changed5 schema fields changedv1.6.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / prefix
      Added value: +{
      +  "description": "Repo-relative folder to search within, e.g. 'src' or 'plugins/iptv'.",
      +  "type": "string"
      +}
    • changedInput schema / properties / query / description
      Previous value: -"Text or regex to search for."New value: +"Text or regex to search for in file contents."
    • changedInput schema / properties / regex / description
      Previous value: -"Treat query as a regex. Default false."New value: +"Treat query as a regex. Default false (literal)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "markdown": {
      +      "description": "Human-readable markdown report. Always present, including empty-result cases. Does not write files.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "markdown"
      +  ],
      +  "type": "object"
      +}
  4. First observedv1.0.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint false, so the description adds real behavioral detail beyond them: default literal/case-sensitive matching, regex compilation without implicit flags, default extension set, hit/line/preview limits, and error behavior for invalid regex and empty results. Nothing contradicts the annotations.

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 a tight block: one purpose sentence, one usage/routing sentence, one defaults sentence, one prefix/globs sentence, and one limits/error sentence. Every sentence earns its place and important facts are front-loaded.

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 four-parameter search tool with output schema and many siblings, the description covers purpose, alternatives, parameter interactions, defaults, limits, and error cases. An agent could select and invoke this tool correctly without needing additional 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?

The schema already describes all four parameters at 100% coverage, so this is above baseline; the description reinforces semantics by adding the default extension list and explicitly stating that prefix and globs combine rather than override, while noting regex gets no implicit flags. This is useful extra meaning even though much of it is already in 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?

Opens with a specific verb and resource: 'Search Lampa source contents for a literal or regex and return path:line plus a preview.' It explicitly names sibling tools find_files, list_catalog, and read_source as things it is not, so an agent can distinguish it from alternatives.

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?

Directly says 'Use this when you know a symbol or pattern; do not use it to list files by name..., dump catalogs..., or read one known path...' and then details how prefix and globs combine. That is explicit when-to-use and when-not-to-use guidance.

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