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 ·

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.

Read the request and assertion together

Open run.mjs and find the unknown variable. The request names an existing tool and supplies a deliberately absent skill. The assertion inspects the application result returned through the RPC wrapper. The saved report includes unknown_skill_rejected: true after that assertion passes.

const unknown = await rpc('tools/call', {
  name: 'get_suede_skill',
  arguments: { name: 'not-a-real-skill' }
});
assert.equal(unknown.result.isError, true);

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.

Run and interpret the saved result

Follow the pinned setup in the demonstration README, then run the command below from suede-seo. The full runner also exercises discovery, search, HTML inspection and answer fixtures. Inspect the MCP subsection to keep the conclusion matched to this lookup case.

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.

node examples/training-proof/run.mjs --skills-repo ../suede-creator-skills-demo --out /tmp/suede-training-proof

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. Repeat the command against the revision you intend to inspect and retain the resulting artifact.

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