Skip to main content
Glama
mcp-sjis-server

mcp-sjis-server

by fukumen

sjis_grep

Search Shift JIS/CP932 files or directories using JavaScript-compatible regex, with glob filtering and matches returned as lines or file paths. Use it instead of terminal grep/rg for legacy Japanese text.

Instructions

Shift JIS/CP932 エンコーディングのファイルやディレクトリから、指定した正規表現パターン(JavaScript/ECMAScript準拠)を検索します。terminal の grep/rg/find の代わりに使用してください。includeGlob でファイル名のglobパターン(例: '.ts', 'README.{md,txt}')に検索対象を絞り込めます。.git ディレクトリは常に除外されます。glob 未指定時はバイナリ形式(png/pdf/zip 等)のファイルも除外します。

outputMode に 'files_only' を指定するとマッチしたファイルパスの一覧のみを返します。context でマッチ行の前後に含める行数を指定できます(content モードのみ有効)。limit と offset で結果をページングできます(limit のデフォルトは100、content モードではマッチ行数、files_only ではファイル数を数えます)。

注意: 検索結果の行末コード(CRLF/LF/CR)は元のファイルのままです。マッチ行は行頭の空白も含め元の行のまま返します。正規表現として一致しない場合、パターンにメタ文字が含まれていればリテラル一致の件数をヒントとして返します。行が2000文字を超える場合は切り詰められます。

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>",
      "path": "<path>"
    },
    "name": "sjis_grep"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes検索対象のディレクトリまたはファイルの絶対パス
limitNo返す結果の最大件数(content: マッチ行数、files_only: ファイル数、デフォルト: 100)
offsetNoスキップする件数(デフォルト: 0)
contextNoマッチ行の前後に含める行数(content モードのみ有効、デフォルト: 0)
patternYes検索する正規表現パターン(JavaScript準拠)
ignoreCaseNo大文字小文字を区別するかどうか(デフォルト: false)
outputModeNo出力形式: 'content'(マッチ行と行番号、デフォルト)または 'files_only'(マッチしたファイルパスの一覧)
includeGlobNo検索対象とするファイル名のglobパターン(例: '*.ts', 'README*.{md,txt}')

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose substantial behavior: .git is always excluded, binary formats are skipped when no glob is given, context applies only to content mode, limit counts match lines vs files, line endings are preserved verbatim, and lines over 2000 chars are truncated. The literal-match hint on non-matching metacharacter patterns is a genuinely useful disclosure. It stops short of stating that this is a non-mutating read-only operation explicitly, but the depth here is well above baseline.

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?

Purpose is front-loaded in the first sentence, followed by filtering behavior, then output/paging semantics, then edge-case caveats. It is longer than most but nearly every sentence adds a distinct operational fact; only the encoding-related notes could be tightened.

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

Completeness3/5

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

For an eight-parameter tool with no annotations and no output schema, the definition covers filtering, paging, mode selection, and truncation well. What it does not describe is the actual shape of a returned match (row/column fields, file grouping) in content mode, which an agent must discover by calling it.

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 all eight parameters and the baseline would be 3. The description adds real meaning beyond it: outputMode 'files_only' semantics, that context is content-mode-only, that limit defaults to 100 and counts matched lines in content mode versus files in files_only mode.

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?

States a specific verb and resource: search files/directories for a JavaScript-compliant regex, explicitly scoped to Shift JIS/CP932 encoding. It is unmistakably the search tool among sjis_read/sjis_write/sjis_patch, so sibling differentiation comes for free from the verb+resource pair.

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?

Explicitly tells the agent to use it in place of terminal grep/rg/find, which is real when-to-use guidance, and explains includeGlob as the narrowing mechanism. It lacks explicit when-not conditions (e.g. when to prefer sjis_read for a single known file), but the context is clear.

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

Deploy Server

Other Tools