check_naming
Assess if an identifier follows project naming conventions, detecting inconsistencies like 'n_dims' vs 'ndim' and returning a consistent/inconsistent verdict with the canonical form and suggestions.
Instructions
Check if an identifier follows project naming conventions — detects inconsistencies like 'n_dims' vs the project's 'ndim' convention, or 'numFeatures' vs 'nb_features'. Returns a consistent/inconsistent verdict with the canonical form and suggestions. Use before committing new code or when reviewing identifier names.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| identifier | Yes | The identifier to check (e.g. 'n_dims') |
Implementation Reference
- pi/extensions/index.ts:164-177 (schema)Schema/definition for the check_naming tool: defines mcpName, label, description, promptSnippet, and parameter schema (identifier string).
{ mcpName: "check_naming", label: "Check Naming", description: "Check if an identifier follows project naming conventions. " + "Returns consistent/inconsistent verdict with canonical form.", promptSnippet: "ontomics_check_naming: validate identifier against project conventions", parameters: Type.Object({ identifier: Type.String({ description: "Identifier to check (e.g. 'n_dims')", }), }), }, - pi/extensions/index.ts:362-387 (registration)Registration loop: iterates over all tool definitions (including check_naming) and registers them with pi.registerTool(), wiring the execute handler that calls the MCP client.
for (const def of toolDefs()) { pi.registerTool({ name: `ontomics_${def.mcpName}`, label: def.label, description: def.description, promptSnippet: def.promptSnippet, promptGuidelines: [ "Use ontomics tools BEFORE grep/glob for semantic codebase questions.", ], parameters: def.parameters, async execute(_toolCallId, params, _signal, onUpdate, _ctx) { onUpdate?.({ content: [{ type: "text", text: `Querying ontomics: ${def.mcpName}...` }], }); try { const mcp = await getClient(); const text = await mcp.callTool(def.mcpName, cleanArgs(params)); return { content: [{ type: "text", text }] }; } catch (err) { throw new Error( `ontomics ${def.mcpName} failed: ${err instanceof Error ? err.message : String(err)}`, ); } }, }); } - pi/extensions/index.ts:44-54 (handler)The actual handler logic via MCP client: callTool dispatches the tool name (e.g. 'check_naming') to the ontomics binary over stdio JSON-RPC. The execute closure (lines 372-386) calls this method.
async callTool( name: string, args: Record<string, unknown>, ): Promise<string> { const result = (await this.request("tools/call", { name, arguments: args, })) as { content?: Array<{ text?: string }> }; const text = result.content?.[0]?.text ?? JSON.stringify(result); return text; }