Skip to content
mcp-tool-discovery logo

MCP Tool Discovery Guide

mcp-tool-discovery

Use this skill when you need to discover MCP tool parameters, understand naming conventions, or debug tool call errors

SKILL.md

Full skill instructions

MCP Tool Discovery Guide

Overview

This skill helps you discover and correctly use MCP tools exposed through the Code Executor MCP server.

Naming Conventions

MCP tools use different naming conventions at different levels:

LevelConventionExample
Original MCP toolkebab-caseresolve-library-id
TypeScript export (primary)camelCaseresolveLibraryId
TypeScript export (alias)snake_caseresolve_library_id

All three are valid for imports. Use whichever you prefer.

The .call() Pattern

All tool exports are objects with a .call() method, not direct functions:

// CORRECT
import * as context7 from "../​servers/​context7/​index.js";
await context7.resolveLibraryId.call({ libraryName: "react" });

// INCORRECT - This won't work
await context7.resolveLibraryId({ libraryName: "react" });

Discovering Parameters

Method 1: Check SCHEMA Export

Every tool exports its JSON Schema:

import { resolveLibraryId } from "../​servers/​context7/​index.js";
console.log(resolveLibraryId.SCHEMA);
// Shows: { type: "object", properties: {...}, required: [...] }

Method 2: Use list_server_tools

// Via MCP tool
{ "tool": "list_server_tools", "server": "context7" }

Method 3: Check Generated .d.ts Files

Look in servers/<server>/<tool>.d.ts for TypeScript definitions.

Common Errors and Solutions

"required property missing"

Cause: A required parameter was not provided.

Solution: Check SCHEMA.required array for required parameters.

"invalid enum value"

Cause: Parameter value not in allowed list.

Solution: Check SCHEMA.properties.<param>.enum for valid values.

"Server not connected"

Cause: Server connection not established.

Solution: The wrapper auto-connects, but if you see this error:

  1. Check server is configured in mcp.json
  2. Check server is enabled (enabled: true)
  3. Use check_server_health tool to diagnose

Quick Reference

// Import a server's tools
import * as serverName from "../​servers/<server>/​index.js";

// Check available exports
console.log(Object.keys(serverName));

// Check a tool's schema
console.log(serverName.toolName.SCHEMA);

// Check original tool name
console.log(serverName.toolName.TOOL_NAME);

// Call the tool
const result = await serverName.toolName.call({ param: "value" });

Config Loading (Important for Scripts)

When writing scripts that use custom config paths, you must set environment variables BEFORE importing the mcp module:

// CORRECT - Set env before dynamic import
process.env.CODE_EXECUTOR_MCP_CONFIG = "path/​to/​mcp.json";
const { checkServerHealth } = await import("../​src/​mcp.js");

// WRONG - Import before setting env (ES modules evaluate immediately)
import { checkServerHealth } from "../​src/​mcp.js";
process.env.CODE_EXECUTOR_MCP_CONFIG = "path/​to/​mcp.json"; // Too late!

This is because ES modules are evaluated at import time, and the config is loaded when the module initializes. Setting environment variables after the import has no effect.

Alternative: Use CLI Arguments

If you're running the server directly, use CLI arguments instead:

node build/​server.js --mcp-config /​path/​to/​mcp.json --skills-config /​path/​to/​skills.json

Scripts

This skill includes utility scripts in the scripts/ folder:

discover-tools.ts

Discover all available MCP servers and their tools programmatically:

import { discoverAllServers, discoverServerTools } from './​scripts/​discover-tools.js';

// Discover all servers
const servers = await discoverAllServers();
console.log(servers);

// Discover tools for a specific server
const context7 = await discoverServerTools('context7');
console.log(context7.tools);

Or run directly to print a summary:

import './​scripts/​discover-tools.js';

test-tool-call.ts

Reference script showing the correct pattern for calling MCP tools. Use as a template for testing tool calls.

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View