Read Tab Content
read_tab_contentExtract readable text content from browser tabs using tab IDs or the active tab. Retrieve specific text sections by setting a starting character position.
Instructions
Get readable content from a tab in the user's browser. Provide ID (from list_tabs output) to read a specific tab, or omit for the active tab.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Tab reference from list_tabs output (e.g: ID:12345:67890). If omitted, uses the currently active tab. | |
| startIndex | No | Starting character position for content extraction (default: 0) |
Implementation Reference
- src/mcp.ts:140-163 (registration)Registration of the read_tab_content tool, including its schema and definition.
server.registerTool( "read_tab_content", { title: "Read Tab Content", description: "Get readable content from a tab in the user's browser. Provide ID (from list_tabs output) to read a specific tab, or omit for the active tab.", inputSchema: { id: z .string() .optional() .describe( "Tab reference from list_tabs output (e.g: ID:12345:67890). If omitted, uses the currently active tab." ), startIndex: z .number() .int() .nonnegative() .optional() .default(0) .describe( "Starting character position for content extraction (default: 0)" ), }, }, - src/mcp.ts:164-178 (handler)Handler implementation for read_tab_content that fetches tab content and formats it for output.
async (args) => { const { id, startIndex } = args; const tab = await getTab(id ? view.parseTabRef(id) : null, options); return { content: [ { type: "text", text: view.formatTabContent( tab, startIndex, options.maxContentChars ), }, ], };