MCP 도구가 잘못 호출되는 이유 디버그
언제 쓸까: 도구를 배포했는데 Claude가 계속 잘못된 인수로 호출할 때.
사전 조건
- Inspector 실행 — npx -y @mcpjam/inspector (브라우저에서 localhost:6274 열림)
- MCP 서버 — stdio 명령 또는 SSE URL로 실행 준비
흐름
-
서버 연결In the inspector UI, add a stdio server: command=node, args=[./dist/server.js].✓ 복사됨→ 설명과 스키마가 있는 도구 목록 표시
-
LLM이 보는 내용 확인Look at the rendered description in the tool detail panel — that's exactly what the model sees.✓ 복사됨→ 모호함 발견 ("id"가 "task_id"여야 하거나, 예시 누락)
-
잘못된 사용 재현Open Chat tab. Send the user prompt that caused the failure. Watch the tool_use payload.✓ 복사됨→ 프로덕션에서 봤던 동일한 잘못된 호출
-
설명 수정 후 재테스트Update the tool's description and example in your server code, restart, retry the same prompt.✓ 복사됨→ 이번엔 올바른 호출
결과: 증거 기반의 before/after로 뒷받침된 구체적인 수정.
함정
- 서버 재시작 후 캐시된 스키마가 남아 있음 — 서버 패널에서 'Reconnect' 클릭; inspector가 list_tools를 다시 가져옴