Practice · MCP integration

Test the failed lookup in an MCP workflow

Use an unknown skill lookup to check a real MCP error response, then separate application errors from transport failures.

Jason Colapietro · Suede AI SEO · · Updated

Make failed lookup a reviewable result

A workflow client needs a useful response when a requested item does not exist. In the Suede Creator Skills demonstration, the client asks get_suede_skill for not-a-real-skill after retrieving a valid workflow. It asserts that the response carries result.isError equal to true.

That case is small enough to understand completely. It checks an unknown skill identifier inside a known tool. An unknown tool name, malformed JSON and a terminated server are separate cases, each with a different place to diagnose the failure.

Inspect the recorded rejection

The saved report includes unknown_skill_rejected: true after the client checks the application result for a deliberately absent skill. The pinned public server shows how get_suede_skill handles that input. Read the result and the implementation together when designing your own assertion.

report_file="$(mktemp)"
curl --fail --show-error --location --max-time 30 https://suedeai.ai/seo/assets/demonstrations/results.json --output "$report_file" &&
REPORT_FILE="$report_file" node --input-type=module <<'JS'
import { readFileSync } from 'node:fs';
const result = JSON.parse(readFileSync(process.env.REPORT_FILE, 'utf8'));
console.log({ server: result.mcp.server, unknown_skill_rejected: result.mcp.unknown_skill_rejected });
JS

Keep failure categories separate

The MCP tools specification distinguishes tool execution errors from protocol-level errors. For this example, use the actual returned shape to write an assertion for the unknown skill. Avoid accepting any truthy error field somewhere in the message: that could count an unrelated failure as the expected decision.

The client also times out an unanswered request after five seconds. A timeout means no response reached that pending request in time. Report it as a client/request failure rather than marking the unknown-skill test passed. Keep stderr with the failed run so the process-level cause remains available.

Create a small failure matrix

Begin with the known-success lookup and the demonstrated unknown-skill lookup. Add a test for a missing required argument only after reading the tool’s input schema and the server’s validation code. A disconnected process deserves its own transport test.

For each row, save the request, the expected layer of failure and the exact assertion. This makes a regression actionable. A changed error shape may require a client update; an unexpected success may mean the server accepted an invalid identifier. Those need different fixes.

  • Valid skill: returned name and non-empty instructions.
  • Unknown skill: explicit application error from the known tool.
  • Invalid arguments: schema or validation response checked separately.
  • No response: timeout and process output retained for diagnosis.

Interpret the saved result

Read the MCP subsection of the public report with the command below. It isolates the recorded unknown-skill decision from the HTML inspection and answer-fixture results. This command reads the saved observation; an integration test against your own server should make and retain its own request.

The recorded result establishes that the pinned server rejected this unknown skill. Add cases from your own workflow before deciding its broader acceptance criteria. Model Context Protocol: Advanced topics and Integrate custom tools into your agent are the relevant issued training records for this exercise; one is a course completion badge and the other a training module achievement badge.

report_file="$(mktemp)"
curl --fail --show-error --location --max-time 30 https://suedeai.ai/seo/assets/demonstrations/results.json --output "$report_file" &&
REPORT_FILE="$report_file" node --input-type=module <<'JS'
import { readFileSync } from 'node:fs';
const result = JSON.parse(readFileSync(process.env.REPORT_FILE, 'utf8'));
console.log(result.recorded_at, result.mcp.source_commit, result.mcp.unknown_skill_rejected);
JS

Issued training connected to this exercise

Inspect the full training inventory · Open the qualifications sheet

Source and recorded result

The demonstration report is dated 2026-10-21. The commands and checklists above explain how to inspect that saved record or capture a new observation from a public page.

Put the workflow to work

Scope an inspectable integration. Bring the workflow, source page or answer your team needs to check so the first deliverable has clear acceptance criteria.

Inspect MCP tools before connecting a workflow · All three working demonstrations