Skip to content

![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg) #5

Description

@Namtanmk

medium

According to CONTRIBUTING.md, there are strict restrictions on the JSON schemas used for tools (specifically, no .nullable() and no .object() types, representing complex objects as short formatted strings instead). Since CLAUDE.md serves as a guide for AI assistants, it is highly beneficial to document these schema restrictions here so that the AI assistant adheres to them when defining new tools.

- `defineTool` — for tools that act on `context` (global operations)
- `definePageTool` — for tools that act on a specific page; receives `request.page`
- Tools that accept CLI arguments use factory form: `defineTool((args) => ({...}))`
- Use `pageIdSchema` and `timeoutSchema` from `ToolDefinition.ts` for common parameters
- **JSON Schema Restrictions**: Do not use `.nullable()` or `.object()` types in schemas; represent complex objects as short formatted strings (per `CONTRIBUTING.md`).

Originally posted by @gemini-code-assist[bot] in thetigerone888/chrome-devtools-mcp#2 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions