Skip to main content
Glama

scan_hardcoded_texts

Detects hardcoded user-facing strings in React Native, React, Next.js, and Flutter projects using AST analysis. Returns source locations, confidence scores, and suggested i18n keys without modifying files.

Instructions

Scan a React Native project (as well as React, Next.js, and Flutter) or requested scope for hardcoded strings using AST analysis. Returns detected strings with source locations, AST context, classification, confidence score, semantic role, suggested key and namespace, without modifying any files.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
scopeNoOptional scope: file path, directory path, glob pattern, or an array of them to limit scanning.
excludeNoOptional glob patterns to exclude from scanning.
includeNoOptional glob patterns to include for scanning.
projectPathNoOptional path to the project root directory. Defaults to the current working directory.
ambiguousOnlyNoWhether to return only ambiguous candidates requiring agent/human evaluation (default: false).
minConfidenceNoMinimum confidence score threshold (0.0 to 1.0) for returned items.
onlyUserFacingNoWhether to return only user-facing strings (default: true). Set to false to include technical strings.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the behavioral burden and does well: it states the tool uses AST analysis, returns source locations and classification details, and explicitly says no files are modified. It does not describe rate limits or error behavior, but for a read-only scanner this is notably transparent.

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 definition is two sentences with no filler: the first front-loads purpose, supported technologies, and method, and the second describes the return shape and non-mutating behavior. Every clause earns its place.

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?

Given seven optional parameters but 100% schema coverage and no output schema, the description is largely complete: it explains the detection method, return contents, and read-only nature. It could add slightly more about how scope interacts with projectPath, but that is already covered in the schema.

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 all seven parameters are already documented in the input schema. The description only gestures at 'requested scope' and adds no additional meaning about ambiguousOnly, minConfidence, or scope-array behavior beyond what the schema provides, making the baseline 3 appropriate.

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 names a specific action (scan), resource (hardcoded strings), technology scope (React Native, React, Next.js, Flutter), and method (AST analysis). It distinguishes the tool from broader project-level siblings implicitly by focusing on hardcoded-string detection, though it does not explicitly contrast with a sibling such as analyze_project.

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?

The description explains what can be scanned but gives no explicit when-to-use guidance, prerequisites, or alternatives. It does not say when to choose this scan over analyze_project or generate_i18n_plan, so the agent must infer the routing from the tool name.

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