get_local_storage
Retrieve all data stored in browser localStorage for debugging web applications, inspecting stored values, and analyzing client-side data persistence.
Instructions
Obtém todos os dados do localStorage
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/browserTools.ts:527-549 (handler)The main handler function for the 'get_local_storage' tool. It uses Puppeteer's page.evaluate to access localStorage, iterates through all keys, collects key-value pairs, and returns them as formatted JSON.* Handler para a ferramenta get_local_storage */ export async function handleGetLocalStorage(currentPage: Page): Promise<ToolResponse> { const storage = await currentPage.evaluate((): Record<string, string> => { const items: Record<string, string> = {}; for (let i = 0; i < localStorage.length; i++) { const key = localStorage.key(i); if (key) { items[key] = localStorage.getItem(key) || ''; } } return items; }); return { content: [ { type: 'text', text: JSON.stringify(storage, null, 2), }, ], }; }
- src/tools.ts:234-241 (schema)The tool schema definition in the tools array, specifying the name, description, and empty input schema (no parameters required).{ name: 'get_local_storage', description: 'Obtém todos os dados do localStorage', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:111-114 (registration)The dispatch logic in the main switch statement that handles calls to 'get_local_storage' by initializing a browser page and invoking the handler.case 'get_local_storage': { const currentPage = await initBrowser(); return await handleGetLocalStorage(currentPage); }
- src/index.ts:21-21 (registration)Import of the handleGetLocalStorage handler function from browserTools.ts.handleGetLocalStorage,