errors

Errors surfaced to MCP clients.

All errors subclass ToolError, so the client receives the message as an isError tool result instead of a generic “Error executing tool” wrapper. Every message starts with a stable [CODE] so agents can branch on it without parsing prose.

class google_scholar_search_mcp.errors.ScholarError(*args, **kwargs)[source]

Bases: ToolError

Base class for errors raised by this server.

Variables:
  • code (str) – Stable machine-readable error code.

  • detail (str) – The message without the [CODE] prefix.

code = 'ERROR'
class google_scholar_search_mcp.errors.ScholarNotFoundError(*args, **kwargs)[source]

Bases: ScholarError

Nothing on Google Scholar matched the request. Retrying will not help.

code = 'NOT_FOUND'
class google_scholar_search_mcp.errors.ScholarRateLimitError(*args, **kwargs)[source]

Bases: ScholarError

Google Scholar throttled the request (HTTP 429). Retry later.

code = 'RATE_LIMITED'
class google_scholar_search_mcp.errors.ScholarBlockedError(*args, **kwargs)[source]

Bases: ScholarRateLimitError

Google Scholar blocks the client (CAPTCHA / max tries). Stop and tell the user.

code = 'BLOCKED'
class google_scholar_search_mcp.errors.ScholarInvalidArgumentError(*args, **kwargs)[source]

Bases: ScholarError

The tool arguments are unusable (e.g. no identifier given). Fix the call.

code = 'INVALID_ARGUMENT'