Skip to content

fix(yoast): advertise noindex as a single boolean type, not [boolean, null]#28

Open
dallinchase wants to merge 1 commit into
GravityKit:developfrom
dallinchase:fix/yoast-noindex-schema-null
Open

fix(yoast): advertise noindex as a single boolean type, not [boolean, null]#28
dallinchase wants to merge 1 commit into
GravityKit:developfrom
dallinchase:fix/yoast-noindex-schema-null

Conversation

@dallinchase

@dallinchase dallinchase commented Jun 14, 2026

Copy link
Copy Markdown

Problem

yoast_update_seo and yoast_bulk_update_seo advertise noindex in their input schema as:

noindex: { type: ['boolean', 'null'], ... }

Anthropic's tool-schema validator (Claude Code, Claude Desktop, and the Anthropic API tool-use endpoint) rejects a "null" member inside a JSON Schema type array. Because tools are validated as a set, this doesn't just disable the noindex field — it returns a 400 for the entire tools/list response, so every tool on the Block MCP server becomes unavailable to Anthropic clients. The server effectively goes dark for Claude users, with an error that points at schema validation rather than this one field.

Fix

Advertise the single scalar type:

noindex: { type: 'boolean', ... }

The runtime handler is unchanged — it still accepts an explicit null (input.noindex === null), so the tri-state semantics (true = noindex / false = explicit index / null = clear to post-type default) are fully preserved. Only the advertised schema drops the rejected null member. Callers that want the default behavior can omit the field or pass null.

Tests

  • Existing noindex tri-state: null is preserved test still passes — confirms behavior is unchanged.
  • Added a regression test asserting no field in the shared YOAST_FIELD_PROPERTIES set advertises a type array containing "null".
✓ src/__tests__/tools/yoast/yoast_update_seo.test.ts (11 tests)

Note on dist/

dist/index.cjs is a build artifact (npm run build / the prepare hook) and is intentionally left out of this PR to keep the diff reviewable. It will regenerate on install/release.

Repro

Connect Block MCP to any Anthropic client with Yoast SEO active on the target site and request tools/list — it returns a 400 validation error citing the null type member, and no tools load. With this change, tools/list succeeds.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Added regression test for Yoast SEO schema validation.
  • Refactor

    • Standardized noindex field type in Yoast SEO tool schema.

… null]

The yoast_update_seo / yoast_bulk_update_seo input schema advertised
noindex as type: ['boolean', 'null']. Anthropic's tool-schema validator
rejects a 'null' member in a JSON Schema type array and returns a 400 for
the ENTIRE tools/list request, which takes every tool on the server
offline for Claude / Anthropic API clients, not just this field.

Schema now advertises type: 'boolean'. The runtime handler is unchanged
and still accepts an explicit null (tri-state true/false/null is preserved;
covered by the existing 'noindex tri-state: null is preserved' test). Added
a regression test asserting no field in the shared Yoast property set uses a
type array containing 'null'.

dist/ is a build artifact (npm run build / prepare) and is intentionally
left out of this PR.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e3240c0f-c0a3-4fd4-9cac-605ee37ecca4

📥 Commits

Reviewing files that changed from the base of the PR and between 5eb1a14 and 78e91c1.

📒 Files selected for processing (2)
  • src/__tests__/tools/yoast/yoast_update_seo.test.ts
  • src/tools/yoast.ts

Walkthrough

The noindex field schema in YOAST_FIELD_PROPERTIES is changed from a boolean | null union type to a single boolean type, with the description updated accordingly. A regression test is added to assert that noindex.type === 'boolean' and that no other schema property uses a type array containing "null".

Changes

Yoast noindex Schema Fix

Layer / File(s) Summary
noindex schema narrowed to boolean, with regression test
src/tools/yoast.ts, src/__tests__/tools/yoast/yoast_update_seo.test.ts
YOAST_FIELD_PROPERTIES.noindex type changed from boolean|null to boolean and its description updated. A new regression test asserts noindex.type === 'boolean' and verifies no schema property uses a type array containing "null".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: fixing the yoast tool's noindex field schema from a type array to a single boolean type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant