Toolhouse · API Governance Rules

Toolhouse API Rules

Spectral linting rules defining API design standards and conventions for Toolhouse.

10 Rules error 3 warn 6
View Rules File View on GitHub

Rule Categories

toolhouse

Rules

warn
toolhouse-operation-summary-title-case
Operation summaries must use Title Case and start with "Toolhouse"
$.paths[*][get,post,put,patch,delete].summary
warn
toolhouse-operation-id-snake-case
OperationIds should be lowercase snake_case
$.paths[*][get,post,put,patch,delete].operationId
error
toolhouse-operation-id-required
All operations must have an operationId
$.paths[*][get,post,put,patch,delete]
error
toolhouse-operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,patch,delete]
error
toolhouse-security-bearer-auth
API uses HTTPBearer authentication - security scheme should be defined
$.components.securitySchemes
hint
toolhouse-me-path-structure
User-scoped paths should follow /me/{resource} pattern
$.paths
warn
toolhouse-uuid-path-param-format
Path parameters ending in _id that use UUID values should have format uuid
$.paths[*][*].parameters[?(@.in=='path')][?(@.name=~/_id$/)]
warn
toolhouse-validation-error-documented
POST/PUT/PATCH operations should document 422 Validation Error response
$.paths[*][post,put,patch].responses
warn
toolhouse-tags-defined
Tags used on operations should be defined at the top level
$
warn
toolhouse-request-body-required
Request bodies should be marked as required for POST/PUT/PATCH
$.paths[*][post,put,patch].requestBody

Spectral Ruleset

Raw ↑
extends: spectral:oas

rules:
  # Toolhouse API uses Title Case summaries with "Toolhouse" prefix
  toolhouse-operation-summary-title-case:
    description: Operation summaries must use Title Case and start with "Toolhouse"
    message: "Operation summary '{{value}}' should start with 'Toolhouse' and use Title Case"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Toolhouse [A-Z]"

  # All operationIds should follow snake_case style (auto-generated FastAPI pattern)
  toolhouse-operation-id-snake-case:
    description: OperationIds should be lowercase snake_case
    message: "OperationId '{{value}}' should be snake_case"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9_]+$"

  # All operations must have operationId
  toolhouse-operation-id-required:
    description: All operations must have an operationId
    message: "Operation is missing an operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  # All operations must have a summary
  toolhouse-operation-summary-required:
    description: All operations must have a summary
    message: "Operation is missing a summary"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  # Bearer token authentication must be defined consistently
  toolhouse-security-bearer-auth:
    description: API uses HTTPBearer authentication - security scheme should be defined
    message: "Security scheme HTTPBearer must be defined in components.securitySchemes"
    severity: error
    given: "$.components.securitySchemes"
    then:
      field: HTTPBearer
      function: truthy

  # Paths under /me/ are user-scoped - should follow /me/{resource} pattern
  toolhouse-me-path-structure:
    description: User-scoped paths should follow /me/{resource} pattern
    message: "Path '{{value}}' under /me/ should follow /me/{resource} convention"
    severity: hint
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^/me/[a-z]"

  # UUIDs used as path parameters should be typed as uuid format
  toolhouse-uuid-path-param-format:
    description: Path parameters ending in _id that use UUID values should have format uuid
    message: "Path parameter '{{path}}' appears to be a UUID but may be missing format: uuid"
    severity: warn
    given: "$.paths[*][*].parameters[?(@.in=='path')][?(@.name=~/_id$/)]"
    then:
      field: schema.format
      function: truthy

  # Responses should document 422 Validation Error for POST/PUT/PATCH
  toolhouse-validation-error-documented:
    description: POST/PUT/PATCH operations should document 422 Validation Error response
    message: "Operation is missing 422 Validation Error response"
    severity: warn
    given: "$.paths[*][post,put,patch].responses"
    then:
      field: "422"
      function: truthy

  # Tags should be defined globally when used on operations
  toolhouse-tags-defined:
    description: Tags used on operations should be defined at the top level
    message: "Top-level tags array should be defined"
    severity: warn
    given: "$"
    then:
      field: tags
      function: truthy

  # Request bodies for POST/PUT/PATCH must be marked required
  toolhouse-request-body-required:
    description: Request bodies should be marked as required for POST/PUT/PATCH
    message: "Request body should be marked as required"
    severity: warn
    given: "$.paths[*][post,put,patch].requestBody"
    then:
      field: required
      function: truthy

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/toolhouse-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.