diff --git a/cursor-problems/REPRODUCE.md b/cursor-problems/REPRODUCE.md new file mode 100644 index 00000000..a4c3a704 --- /dev/null +++ b/cursor-problems/REPRODUCE.md @@ -0,0 +1,44 @@ +# Reproducing Cursor Problems + +Each subdirectory contains a `request.json` (the request body) and `response.json` (the error response received). + +## Using curl to reproduce + +From the `routstr-core/` directory: + +```bash +# OpenAI model error +curl -X POST https://staging.routstr.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $API_KEY" \ + -d @cursor-problems/openai-model-error/request.json + +# Anthropic internal error +curl -X POST https://staging.routstr.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $API_KEY" \ + -d @cursor-problems/anthropic-internal-error/request.json + +# Model not found error +curl -X POST https://staging.routstr.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $API_KEY" \ + -d @cursor-problems/model-not-found-error/request.json + +# Upstream rate limit error +curl -X POST https://staging.routstr.com/v1/chat/completions \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $API_KEY" \ + -d @cursor-problems/upstream-rate-limit-error/request.json +``` + +## Generic pattern + +```bash +curl -X POST \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer $API_KEY" \ + -d @cursor-problems//request.json +``` + +The `-d @filename` syntax tells curl to read the request body from a file. diff --git a/cursor-problems/anthropic-internal-error/request.json b/cursor-problems/anthropic-internal-error/request.json new file mode 100644 index 00000000..106aff4f --- /dev/null +++ b/cursor-problems/anthropic-internal-error/request.json @@ -0,0 +1,957 @@ +{ + "model": "anthropic/claude-sonnet-4.5", + "temperature": 1, + "max_tokens": 4096, + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "\nOS Version: darwin 24.6.0\nCurrent Date: Friday Dec 26, 2025\nShell: /bin/zsh\nWorkspace Path: /Users/fungus/dev/routstr-chat\nTerminals folder: /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals\nNote: Prefer using absolute paths over relative paths as tool call args when possible.\n\n\n\nThe rules section has a number of possible rules/memories/context that you should consider. In each subsection, we provide instructions about what information the subsection contains and how you should consider/follow the contents of the subsection.\n\n\n\n\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n\n\n\n\n\n\nBelow is a snapshot of the current workspace's file structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n/Users/fungus/dev/routstr-chat/\n - app/\n - favicon.ico\n - globals.css\n - layout.tsx\n - manifest.ts\n - offline/\n - page.tsx\n - page.tsx\n - codex.md\n - components/\n - AppProvider.tsx\n - bitcoin-connect/\n - BitcoinConnectClient.tsx\n - chat/\n - ChatContainer.tsx\n - ChatHeader.tsx\n - ChatInput.tsx\n - ChatMessages.tsx\n - MainChatArea.tsx\n - ModelSelector.tsx\n - Sidebar.tsx\n - VersionNavigator.tsx\n - ClientProviders.tsx\n - CodeBlock.tsx\n - InvoiceRecoveryProvider.tsx\n - LoginModal.tsx\n - MarkdownRenderer.tsx\n - MessageContent.tsx\n - NostrProvider.tsx\n - pwa/\n - KeepAliveProvider.tsx\n - QRCodeModal.tsx\n - QueryTimeoutModal.tsx\n - settings/\n - ApiKeysTab.tsx\n - AutoRefillSettings.tsx\n - GeneralTab.tsx\n - HistoryTab.tsx\n - ModelsTab.tsx\n - NostrRelayManager.tsx\n - NWCWalletManager.tsx\n - ThemeSettings.tsx\n - SettingsModal.tsx\n - SWUpdater.tsx\n - ThemeProvider.tsx\n - TopUpPromptModal.tsx\n - ui/\n - Popover.tsx\n - SettingsDialog.tsx\n - sonner.tsx\n - switch.tsx\n - ThinkingSection.tsx\n - context/\n - AppContext.ts\n - AuthProvider.tsx\n - ChatProvider.tsx\n - NostrContext.tsx\n - docker/\n - Dockerfile\n - nginx.conf\n - README.md\n - features/\n - wallet/\n - components/\n [8 files in subtree: 7 *.tsx, 1 *.ts]\n - core/\n [15 files in subtree: 15 *.ts]\n - hooks/\n [7 files in subtree: 7 *.ts]\n - index.ts\n - README.md\n - state/\n [4 files in subtree: 4 *.ts]\n - hooks/\n - useApiKeysSync.ts\n - useApiState.ts\n - useAppContext.ts\n - useAuthor.ts\n - useAuthState.ts\n - useAutoRefill.ts\n - useCashuWithXYZ.ts\n - useChatActions.ts\n - useChatSync.ts\n - useChatSync1081.ts\n - useConversationState.ts\n - useCurrentUser.ts\n - useDeletionSync.ts\n - useInvoiceChecker.ts\n - useInvoiceSync.ts\n - useKeepAlive.ts\n - useLocalStorage.ts\n - useLoggedInAccounts.ts\n - useLoginActions.ts\n - useMediaQuery.ts\n - useModelState.ts\n - useNostr.ts\n - useProviderBalancesSync.ts\n - useUiState.ts\n - lib/\n - applesauce-core.ts\n - cashu.ts\n - cashuLightning.ts\n - eventDatabase/\n - eventStore.ts\n - filters.ts\n - index.ts\n - README.md\n - replaceables.ts\n - types.ts\n - ZUSTAND_EVENT_DATABASE_ARCHITECTURE.md\n - nostr-kinds.ts\n - nostr.ts\n - nostrTimestamps.ts\n - nwcPayment.ts\n - pns.ts\n - preconfiguredModels.ts\n - utils.ts\n - mocks/\n - browser.ts\n - handlers.ts\n - next-env.d.ts\n - next.config.ts\n - node_modules/\n - out/\n - _next/\n - 4onb-t6pq81kWzwxpM6mv/...\n - static/...\n - 404.html\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - favicon.ico\n - icons/...\n - index.html\n - index.txt\n - logo.jpeg\n - manifest.webmanifest\n - mockServiceWorker.js\n - offline.html\n - offline.txt\n - sw.js\n - workbox-764987ff.js\n - package-lock.json\n - package.json\n - playwright.config.ts\n - postcss.config.mjs\n - public/\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - icons/\n [4 files in subtree: 4 *.png]\n - logo.jpeg\n - mockServiceWorker.js\n - sw.js\n - workbox-764987ff.js\n - README.md\n - test/\n - e2e-invoice.test.js\n - invoice-integration.test.js\n - invoice-persistence.test.js\n - invoice-status-states.test.js\n - LIGHTNING_TESTING_SETUP.md\n - pay-invoice.sh\n - README.md\n - run-tests.sh\n - setup-regtest-mint.sh\n - tests/\n - e2e/\n [3 files in subtree: 2 *.ts, 1 *.md]\n - tsconfig.json\n - types/\n - chat.ts\n - minimatch.d.ts\n - models.ts\n - next-pwa.d.ts\n - pdfjs-worker.d.ts\n - react-syntax-highlighter.d.ts\n - utils/\n - apiUtils.ts\n - cashuUtils.ts\n - conversationUtils.ts\n - download.ts\n - eventProcessing.ts\n - indexedDb.ts\n - messageUtils.ts\n - modelUtils.ts\n - pdfUtils.ts\n - storageManager.ts\n - storageUtils.ts\n - thinkingParser.ts\n - walletUtils.ts\n\n\n\nNote: File extension counts do not include files ignored by .gitignore.", + "cache_control": { + "type": "ephemeral" + } + }, + { + "type": "text", + "text": "\nBelow are some potentially helpful/relevant pieces of information for figuring out how to respond:\n\nRecently viewed files (recent at the top, oldest at the bottom):\n- /Users/fungus/dev/routstr-chat/components/chat/ChatMessages.tsx (total lines: 1123)\n- /Users/fungus/dev/routstr-chat/context/AppContext.ts (total lines: 18)\n- /Users/fungus/dev/routstr-chat/features/wallet/components/BalanceDisplay.tsx (total lines: 2167)\n- /Users/fungus/dev/routstr-chat/utils/modelUtils.ts (total lines: 456)\n\nFiles that are currently open and visible in the user's IDE:\n- /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals/1.txt (total lines: 27)\n\nNote: these files may or may not be relevant to the current conversation. Use the read_file tool if you need to get the contents of some of them.\n\n\n\n\nhey\n\n", + "cache_control": { + "type": "ephemeral" + } + } + ] + } + ], + "tools": [ + { + "name": "codebase_search", + "description": "`codebase_search`: semantic search that finds code by meaning, not exact text\n\n### When to Use This Tool\n\nUse `codebase_search` when you need to:\n- Explore unfamiliar codebases\n- Ask \"how / where / what\" questions to understand behavior\n- Find code by meaning rather than exact text\n\n### When NOT to Use\n\nSkip `codebase_search` for:\n1. Exact text matches (use `grep`)\n2. Reading known files (use `read_file`)\n3. Simple symbol lookups (use `grep`)\n4. Find file by name (use `file_search`)\n\n### Examples\n\n\n Query: \"Where is interface MyInterface implemented in the frontend?\"\n\n Good: Complete question asking about implementation location with specific context (frontend).\n\n\n\n\n Query: \"Where do we encrypt user passwords before saving?\"\n\n Good: Clear question about a specific process with context about when it happens.\n\n\n\n\n Query: \"MyInterface frontend\"\n\n BAD: Too vague; use a specific question instead. This would be better as \"Where is MyInterface used in the frontend?\"\n\n\n\n\n Query: \"AuthService\"\n\n BAD: Single word searches should use `grep` for exact text matching instead.\n\n\n\n\n Query: \"What is AuthService? How does AuthService work?\"\n\n BAD: Combines two separate queries. A single semantic search is not good at looking for multiple things in parallel. Split into separate parallel searches: like \"What is AuthService?\" and \"How does AuthService work?\"\n\n\n\n### Target Directories\n\n- Provide ONE directory or file path; [] searches the whole repo. No globs or wildcards.\n Good:\n - [\"backend/api/\"] - focus directory\n - [\"src/components/Button.tsx\"] - single file\n - [] - search everywhere when unsure\n BAD:\n - [\"frontend/\", \"backend/\"] - multiple paths\n - [\"src/**/utils/**\"] - globs\n - [\"*.ts\"] or [\"**/*\"] - wildcard paths\n\n### Search Strategy\n\n1. Start with exploratory queries - semantic search is powerful and often finds relevant context in one go. Begin broad with [] if you're not sure where relevant code is.\n2. Review results; if a directory or file stands out, rerun with that as the target.\n3. Break large questions into smaller ones (e.g. auth roles vs session storage).\n4. For big files (>1K lines) run `codebase_search`, or `grep` if you know the exact symbols you're looking for, scoped to that file instead of reading the entire file.\n\n\n Step 1: { \"query\": \"How does user authentication work?\", \"target_directories\": [], \"explanation\": \"Find auth flow\" }\n Step 2: Suppose results point to backend/auth/ → rerun:\n { \"query\": \"Where are user roles checked?\", \"target_directories\": [\"backend/auth/\"], \"explanation\": \"Find role logic\" }\n\n Good strategy: Start broad to understand overall system, then narrow down to specific areas based on initial results.\n\n\n\n\n Query: \"How are websocket connections handled?\"\n Target: [\"backend/services/realtime.ts\"]\n\n Good: We know the answer is in this specific file, but the file is too large to read entirely, so we use semantic search to find the relevant parts.\n\n\n\n### Usage\n- When full chunk contents are provided, avoid re-reading the exact same chunk contents using the read_file tool.\n- Sometimes, just the chunk signatures and not the full chunks will be shown. Chunk signatures are usually Class or Function signatures that chunks are contained in. Use the read_file or grep tools to explore these chunks or files if you think they might be relevant.\n- When reading chunks that weren't provided as full chunks (e.g. only as line ranges or signatures), you'll sometimes want to expand the chunk ranges to include the start of the file to see imports, expand the range to include lines from the signature, or expand the range to read multiple chunks from a file at once.", + "input_schema": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + }, + "query": { + "type": "string", + "description": "A complete question about what you want to understand. Ask as if talking to a colleague: 'How does X work?', 'What happens when Y?', 'Where is Z handled?'" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Prefix directory paths to limit search scope (single directory only, no glob patterns)" + }, + "num_results": { + "type": "integer", + "description": "The number of results to return. Defaults to 15. Do not specify a value larger than 15." + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + } + }, + { + "name": "run_terminal_cmd", + "description": "PROPOSE a command to run on behalf of the user.\nNote that the user may have to approve the command before it is executed.\nThe user may reject it if it is not to their liking, or may modify the command before approving it. If they do change it, take those changes into account.\nIn using these tools, adhere to the following guidelines:\n1. Before starting servers or long-running processes, list the terminals folder to check if they are already running in existing terminals.\n2. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a different shell.\n3. If in a new shell, you should `cd` to the appropriate directory and do necessary setup in addition to running the command. By default, the shell will initialize in the project root.\n4. If in the same shell, LOOK IN CHAT HISTORY for your current working directory. The environment also persists (e.g. exported env vars, venv/nvm activations).\n5. For ANY commands that would require user interaction, ASSUME THE USER IS NOT AVAILABLE TO INTERACT and PASS THE NON-INTERACTIVE FLAGS (e.g. --yes for npx).\n6. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\n7. NEVER update the git config\n8. NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them\n9. NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n10. NEVER run force push to main/master, warn the user if they request it\n11. NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\nBy default, your commands will run in a sandbox. The sandbox allows most writes to the workspace and reads to the rest of the filesystem. Network access, modifications to git state and modifications to ignored files are disallowed. Reads to git state are allowed. Some other syscalls are also disallowed like access to USB devices. Syscalls that attempt forbidden operations will fail and not all programs will surface these errors in a useful way.\nFiles that are ignored by .gitignore or .cursorignore are not accessible to the command. If you need to access a file that is ignored, you will need to request \"all\" permissions to disable sandboxing.\nThe required_permissions argument is used to request additional permissions. If you know you will need a permission, request it. Requesting permissions will slow down the command execution as it will ask the user for approval. Do not hesitate to request permissions if you are certain you need them.\nThe following permissions are supported:\n- network: Grants broad network access to run a server or contact the internet. Needed for package installs, API calls, hosting servers and fetching dependencies.\n- git_write: Allows write access to .git directories. Required if you want to make commits, checkout a branch or otherwise modify any git state. Not required for read-only commands like git status or git log.\n- all: Disables the sandbox entirely. If all is requested the command will not run in a sandbox and the sandbox cannot impact the result of the command.\nOnly request permissions when they are actually needed for the command to succeed. Most file operations, reading, and local builds work fine in the default sandbox.\nMake sure to request git_write permissions if you need to make changes to the git repository, including staging, unstaging or committing.\nIf you think a command failed due to sandbox restrictions, run the command again with the required_permissions argument to request what you need. Don't change the code, just request the permissions.", + "input_schema": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The terminal command to execute" + }, + "is_background": { + "type": "boolean", + "description": "Whether the command should be run in the background" + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this command needs to be run and how it contributes to the goal." + }, + "required_permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "git_write", + "network", + "all" + ] + }, + "description": "Optional list of permissions to request if the command needs them (git_write, network, all)." + } + }, + "required": [ + "command", + "is_background" + ] + } + }, + { + "name": "grep", + "description": "A powerful search tool built on ripgrep\n\nUsage:\n- Prefer grep for exact symbol/string searches. Whenever possible, use this instead of terminal grep/rg. This tool is faster and respects .gitignore/.cursorignore.\n- Supports full regex syntax, e.g. \"log.*Error\", \"function\\s+\\w+\". Ensure you escape special chars to get exact matches, e.g. \"functionCall\\(\"\n- Avoid overly broad glob patterns (e.g., '--glob *') as they bypass .gitignore rules and may be slow\n- Only use 'type' (or 'glob' for file types) when certain of the file type needed. Note: import paths may not match source file types (.js vs .ts)\n- Output modes: \"content\" shows matching lines (default), \"files_with_matches\" shows only file paths, \"count\" shows match counts per file\n- Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (e.g. use interface\\{\\} to find interface{} in Go code)\n- Multiline matching: By default patterns match within single lines only. For cross-line patterns like struct \\{[\\s\\S]*?field, use multiline: true\n- Results are capped for responsiveness; truncated results show \"at least\" counts.\n- Content output follows ripgrep format: '-' for context lines, ':' for match lines, and all lines grouped by file.\n- Unsaved or out of workspace active editors are also searched and show \"(unsaved)\" or \"(out of workspace)\". Use absolute paths to read/edit these files.", + "input_schema": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "The regular expression pattern to search for in file contents (rg --regexp)" + }, + "path": { + "type": "string", + "description": "File or directory to search in (rg pattern -- PATH). Defaults to Cursor workspace roots." + }, + "glob": { + "type": "string", + "description": "Glob pattern (rg --glob GLOB -- PATH) to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")." + }, + "output_mode": { + "type": "string", + "description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"content\".", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise." + }, + "-A": { + "type": "number", + "description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise." + }, + "-C": { + "type": "number", + "description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise." + }, + "-i": { + "type": "boolean", + "description": "Case insensitive search (rg -i) Defaults to false" + }, + "type": { + "type": "string", + "description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than glob for standard file types." + }, + "head_limit": { + "type": "number", + "description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). When unspecified, shows all ripgrep results." + }, + "multiline": { + "type": "boolean", + "description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false." + } + }, + "required": [ + "pattern" + ] + } + }, + { + "name": "delete_file", + "description": "Deletes a file at the specified path. The operation will fail gracefully if:\n - The file doesn't exist\n - The operation is rejected for security reasons\n - The file cannot be deleted", + "input_schema": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to delete, relative to the workspace root." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + }, + "required": [ + "target_file" + ] + } + }, + { + "name": "web_search", + "description": "Search the web for real-time information about any topic. Use this tool when you need up-to-date information that might not be available in your training data, or when you need to verify current facts. The search results will include relevant snippets and URLs from web pages. This is particularly useful for questions about current events, technology updates, or any topic that requires recent information.", + "input_schema": { + "type": "object", + "required": [ + "search_term" + ], + "properties": { + "search_term": { + "type": "string", + "description": "The search term to look up on the web. Be specific and include relevant keywords for better results. For technical queries, include version numbers or dates if relevant." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + } + } + }, + { + "name": "update_memory", + "description": "Creates, updates, or deletes a memory in a persistent knowledge base for future reference by the AI.\nIf the user augments an existing memory, you MUST use this tool with the action 'update'.\nIf the user contradicts an existing memory, it is critical that you use this tool with the action 'delete', not 'update', or 'create'.\nTo update or delete an existing memory, you MUST provide the existing_knowledge_id parameter.\nIf the user asks to remember something, for something to be saved, or to create a memory, you MUST use this tool with the action 'create'.\nUnless the user explicitly asks to remember or save something, DO NOT call this tool with the action 'create'.\n", + "input_schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The title of the memory to be stored. This can be used to look up and retrieve the memory later. This should be a short title that captures the essence of the memory. Required for 'create' and 'update' actions." + }, + "knowledge_to_store": { + "type": "string", + "description": "The specific memory to be stored. It should be no more than a paragraph in length. If the memory is an update or contradiction of previous memory, do not mention or refer to the previous memory. Required for 'create' and 'update' actions." + }, + "action": { + "type": "string", + "enum": [ + "create", + "update", + "delete" + ], + "description": "The action to perform on the knowledge base. Defaults to 'create' if not provided for backwards compatibility." + }, + "existing_knowledge_id": { + "type": "string", + "description": "Required if action is 'update' or 'delete'. The ID of existing memory to update instead of creating new memory." + } + }, + "required": [] + } + }, + { + "name": "read_lints", + "description": "Read and display linter errors from the current workspace. You can provide paths to specific files or directories, or omit the argument to get diagnostics for all files.\n\n- If a file path is provided, returns diagnostics for that file only\n- If a directory path is provided, returns diagnostics for all files within that directory\n- If no path is provided, returns diagnostics for all files in the workspace\n- This tool can return linter errors that were already present before your edits, so avoid calling it with a very wide scope of files\n- NEVER call this tool on a file unless you've edited it or are about to edit it", + "input_schema": { + "type": "object", + "properties": { + "paths": { + "description": "Optional. An array of paths to files or directories to read linter errors for. You can use either relative paths in the workspace or absolute paths. If provided, returns diagnostics for the specified files/directories only. If not provided, returns diagnostics for all files in the workspace.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + } + }, + { + "name": "edit_notebook", + "description": "Use this tool to edit a jupyter notebook cell. Use ONLY this tool to edit notebooks.\n\nThis tool supports editing existing cells and creating new cells:\n\t- If you need to edit an existing cell, set 'is_new_cell' to false and provide the 'old_string' and 'new_string'.\n\t\t-- The tool will replace ONE occurrence of 'old_string' with 'new_string' in the specified cell.\n\t- If you need to create a new cell, set 'is_new_cell' to true and provide the 'new_string' (and keep 'old_string' empty).\n\t- It's critical that you set the 'is_new_cell' flag correctly!\n\t- This tool does NOT support cell deletion, but you can delete the content of a cell by passing an empty string as the 'new_string'.\n\nOther requirements:\n\t- Cell indices are 0-based.\n\t- 'old_string' and 'new_string' should be a valid cell content, i.e. WITHOUT any JSON syntax that notebook files use under the hood.\n\t- The old_string MUST uniquely identify the specific instance you want to change. This means:\n\t\t-- Include AT LEAST 3-5 lines of context BEFORE the change point\n\t\t-- Include AT LEAST 3-5 lines of context AFTER the change point\n\t- This tool can only change ONE instance at a time. If you need to change multiple instances:\n\t\t-- Make separate calls to this tool for each instance\n\t\t-- Each call must uniquely identify its specific instance using extensive context\n\t- This tool might save markdown cells as \"raw\" cells. Don't try to change it, it's fine. We need it to properly display the diff.\n\t- If you need to create a new notebook, just set 'is_new_cell' to true and cell_idx to 0.\n\t- ALWAYS generate arguments in the following order: target_notebook, cell_idx, is_new_cell, cell_language, old_string, new_string.\n\t- Prefer editing existing cells over creating new ones!\n\t- ALWAYS provide ALL required arguments (including BOTH old_string and new_string). NEVER call this tool without providing 'new_string'.\n", + "input_schema": { + "type": "object", + "properties": { + "target_notebook": { + "type": "string", + "description": "The path to the notebook file you want to edit. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "cell_idx": { + "type": "number", + "description": "The index of the cell to edit (0-based)" + }, + "is_new_cell": { + "type": "boolean", + "description": "If true, a new cell will be created at the specified cell index. If false, the cell at the specified cell index will be edited." + }, + "cell_language": { + "type": "string", + "description": "The language of the cell to edit. Should be STRICTLY one of these: 'python', 'markdown', 'javascript', 'typescript', 'r', 'sql', 'shell', 'raw' or 'other'." + }, + "old_string": { + "type": "string", + "description": "The text to replace (must be unique within the cell, and must match the cell contents exactly, including all whitespace and indentation)." + }, + "new_string": { + "type": "string", + "description": "The edited text to replace the old_string or the content for the new cell." + } + }, + "required": [ + "target_notebook", + "cell_idx", + "is_new_cell", + "cell_language", + "old_string", + "new_string" + ] + } + }, + { + "name": "todo_write", + "description": "Use this tool to create and manage a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.\n\nNote: Other than when first creating todos, don't tell the user you're updating todos, just do it.\n\n### When to Use This Tool\n\nUse proactively for:\n1. Complex multi-step tasks (3+ distinct steps)\n2. Non-trivial tasks requiring careful planning\n3. User explicitly requests todo list\n4. User provides multiple tasks (numbered/comma-separated)\n5. After receiving new instructions - capture requirements as todos (use merge=false to add new ones)\n6. After completing tasks - mark complete with merge=true and add follow-ups\n7. When starting new tasks - mark as in_progress (ideally only one at a time)\n\n### When NOT to Use\n\nSkip for:\n1. Single, straightforward tasks\n2. Trivial tasks with no organizational benefit\n3. Tasks completable in < 3 trivial steps\n4. Purely conversational/informational requests\n5. Todo items should NOT include operational actions done in service of higher-level tasks.\n\nNEVER INCLUDE THESE IN TODOS: linting; testing; searching or examining the codebase.\n\n### Examples\n\n\n User: Add dark mode toggle to settings\n Assistant:\n - *Creates todo list:*\n 1. Add state management [in_progress]\n 2. Implement styles\n 3. Create toggle component\n 4. Update components\n - [Immediately begins working on todo 1 in the same tool call batch]\n\n Multi-step feature with dependencies.\n\n\n\n\n User: Rename getCwd to getCurrentWorkingDirectory across my project\n Assistant: *Searches codebase, finds 15 instances across 8 files*\n *Creates todo list with specific items for each file that needs updating*\n\n\n Complex refactoring requiring systematic tracking across multiple files.\n\n\n\n\n User: Implement user registration, product catalog, shopping cart, checkout flow.\n Assistant: *Creates todo list breaking down each feature into specific tasks*\n\n\n Multiple complex features provided as list requiring organized task management.\n\n\n\n\n User: Optimize my React app - it's rendering slowly.\n Assistant: *Analyzes codebase, identifies issues*\n *Creates todo list: 1) Memoization, 2) Virtualization, 3) Image optimization, 4) Fix state loops, 5) Code splitting*\n\n\n Performance optimization requires multiple steps across different components.\n\n\n\n### Examples of When NOT to Use the Todo List\n\n\n User: What does git status do?\n Assistant: Shows current state of working directory and staging area...\n\n\n Informational request with no coding task to complete.\n\n\n\n\n User: Add comment to calculateTotal function.\n Assistant: *Uses edit tool to add comment*\n\n\n Single straightforward task in one location.\n\n\n\n\n User: Run npm install for me.\n Assistant: *Executes npm install* Command completed successfully...\n\n\n Single command execution with immediate results.\n\n\n\n### Task States and Management\n\n1. **Task States:**\n - pending: Not yet started\n - in_progress: Currently working on\n - completed: Finished successfully\n - cancelled: No longer needed\n\n2. **Task Management:**\n - Update status in real-time\n - Mark complete IMMEDIATELY after finishing\n - Only ONE task in_progress at a time\n - Complete current tasks before starting new ones\n\n3. **Task Breakdown:**\n - Create specific, actionable items\n - Break complex tasks into manageable steps\n - Use clear, descriptive names\n\n4. **Parallel Todo Writes:**\n - Prefer creating the first todo as in_progress\n - Start working on todos by using tool calls in the same tool call batch as the todo write\n - Batch todo updates with other tool calls for better latency and lower costs for the user\n\nWhen in doubt, use this tool. Proactive task management demonstrates attentiveness and ensures complete requirements.", + "input_schema": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "Whether to merge the todos with the existing todos. If true, the todos will be merged into the existing todos based on the id field. You can leave unchanged properties undefined. If false, the new todos will replace the existing todos." + }, + "todos": { + "type": "array", + "description": "Array of todo items to write to the workspace", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The description/content of the todo item", + "maxLength": 70 + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "The current status of the todo item" + }, + "id": { + "type": "string", + "description": "Unique identifier for the todo item" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + } + }, + { + "name": "search_replace", + "description": "Performs exact string replacements in files.\n\nUsage:\n- When editing text, ensure you preserve the exact indentation (tabs/spaces) as it appears before.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.\n- The edit will FAIL if old_string is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use replace_all to change every instance of old_string.\n- Use replace_all for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.\n- To create or overwrite a file, you should prefer the write tool.", + "input_schema": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument. You can use either a relative path in the workspace or an absolute path." + }, + "old_string": { + "type": "string", + "description": "The text to replace" + }, + "new_string": { + "type": "string", + "description": "The text to replace it with (must be different from old_string)" + }, + "replace_all": { + "type": "boolean", + "description": "Replace all occurences of old_string (default false)" + } + }, + "required": [ + "file_path", + "old_string", + "new_string" + ] + } + }, + { + "name": "write", + "description": "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the read_file tool first to read the file's contents.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.", + "input_schema": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument. You can use either a relative path in the workspace or an absolute path." + }, + "contents": { + "type": "string", + "description": "The contents of the file to write" + } + }, + "required": [ + "file_path", + "contents" + ] + } + }, + { + "name": "read_file", + "description": "\nReads a file from the local filesystem. You can access any file directly by using this tool.\nIf the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters.\n- Lines in the output are numbered starting at 1, using following format: LINE_NUMBER|LINE_CONTENT.\n- You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.\n- If you read a file that exists but has empty contents you will receive 'File is empty.'.\n\n\nImage Support:\n- This tool can also read image files when called with the appropriate path.\n- Supported image formats: jpeg/jpg, png, gif, webp.", + "input_schema": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to read. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "offset": { + "type": "integer", + "description": "The line number to start reading from. Only provide if the file is too large to read at once." + }, + "limit": { + "type": "integer", + "description": "The number of lines to read. Only provide if the file is too large to read at once." + } + }, + "required": [ + "target_file" + ] + } + }, + { + "name": "list_dir", + "description": "Lists files and directories in a given path.\nThe 'target_directory' parameter can be relative to the workspace root or absolute.\nYou can optionally provide an array of glob patterns to ignore with the \"ignore_globs\" parameter.\n\nOther details:\n- The result does not display dot-files and dot-directories.\n", + "input_schema": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to list contents of." + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of glob patterns to ignore.\nAll patterns match anywhere in the target directory. Patterns not starting with \"**/\" are automatically prepended with \"**/\".\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - ignore all .js files\n\t- \"**/node_modules/**\" - ignore all node_modules directories\n\t- \"**/test/**/test_*.ts\" - ignore all test_*.ts files in any test directory\n" + } + }, + "required": [ + "target_directory" + ] + } + }, + { + "name": "glob_file_search", + "description": "\nTool to search for files matching a glob pattern\n\n- Works fast with codebases of any size\n- Returns matching file paths sorted by modification time\n- Use this tool when you need to find files by name patterns\n- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches that are potentially useful as a batch.\n", + "input_schema": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to search for files in. If not provided, defaults to Cursor workspace roots." + }, + "glob_pattern": { + "type": "string", + "description": "The glob pattern to match files against.\nPatterns not starting with \"**/\" are automatically prepended with \"**/\" to enable recursive searching.\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - find all .js files\n\t- \"**/node_modules/**\" - find all node_modules directories\n\t- \"**/test/**/test_*.ts\" - find all test_*.ts files in any test directory\n" + } + }, + "required": [ + "glob_pattern" + ] + } + }, + { + "name": "list_mcp_resources", + "description": "List available resources from configured MCP servers. Each returned resource will include all standard MCP resource fields plus a 'server' field indicating which server the resource belongs to.", + "input_schema": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "Optional server identifier to filter resources by. If not provided, resources from all servers will be returned." + } + }, + "required": [] + } + }, + { + "name": "fetch_mcp_resource", + "description": "Reads a specific resource from an MCP server, identified by server name and resource URI. Optionally, set downloadPath (relative to the workspace) to save the resource to disk; when set, the resource will be downloaded and not returned to the model.", + "input_schema": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "The MCP server identifier" + }, + "uri": { + "type": "string", + "description": "The resource URI to read" + }, + "downloadPath": { + "type": "string", + "description": "Optional relative path in the workspace to save the resource to. When set, the resource is written to disk and is not returned to the model." + } + }, + "required": [ + "server", + "uri" + ] + } + }, + { + "name": "mcp_cursor-browser-extension_browser_navigate", + "description": "Navigate to a URL", + "input_schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL to navigate to" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_navigate_back", + "description": "Go back to the previous page", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_resize", + "description": "Resize the browser window", + "input_schema": { + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "Width of the browser window" + }, + "height": { + "type": "number", + "description": "Height of the browser window" + } + }, + "required": [ + "width", + "height" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_snapshot", + "description": "Capture accessibility snapshot of the current page. Use this to get element refs for interactions, not browser_take_screenshot.", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_wait_for", + "description": "Wait for text to appear or disappear or a specified time to pass", + "input_schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "description": "The time to wait in seconds" + }, + "text": { + "type": "string", + "description": "The text to wait for" + }, + "textGone": { + "type": "string", + "description": "The text to wait for to disappear" + } + }, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_press_key", + "description": "Press a key on the keyboard", + "input_schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Name of the key to press or a character to generate, such as `ArrowLeft` or `a`" + } + }, + "required": [ + "key" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_console_messages", + "description": "Returns all console messages", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_network_requests", + "description": "Returns all network requests since loading the page", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_click", + "description": "Perform click on a web page", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "doubleClick": { + "type": "boolean", + "description": "Whether to perform a double click instead of a single click" + }, + "button": { + "type": "string", + "enum": [ + "left", + "right", + "middle" + ], + "description": "Button to click, defaults to left" + }, + "modifiers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Alt", + "Control", + "ControlOrMeta", + "Meta", + "Shift" + ] + }, + "description": "Modifier keys to press" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_hover", + "description": "Hover over element on page", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_type", + "description": "Type text into editable element", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "text": { + "type": "string", + "description": "Text to type into the element" + }, + "submit": { + "type": "boolean", + "description": "Whether to submit entered text (press Enter after)" + }, + "slowly": { + "type": "boolean", + "description": "Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once." + } + }, + "required": [ + "element", + "ref", + "text" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_select_option", + "description": "Select an option in a dropdown", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of values to select in the dropdown. This can be a single value or multiple values." + } + }, + "required": [ + "element", + "ref", + "values" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_drag", + "description": "Perform drag and drop between two elements", + "input_schema": { + "type": "object", + "properties": { + "startElement": { + "type": "string", + "description": "Human-readable source element description used to obtain the permission to interact with the element" + }, + "startRef": { + "type": "string", + "description": "Exact source element reference from the page snapshot" + }, + "endElement": { + "type": "string", + "description": "Human-readable target element description used to obtain the permission to interact with the element" + }, + "endRef": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "startElement", + "startRef", + "endElement", + "endRef" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_evaluate", + "description": "Evaluate JavaScript expression on page or element", + "input_schema": { + "type": "object", + "properties": { + "function": { + "type": "string", + "description": "() => { /* code */ } or (element) => { /* code */ } when element/ref is provided" + }, + "element": { + "type": "string", + "description": "Description of the element, if evaluating on an element" + }, + "ref": { + "type": "string", + "description": "CSS selector to find element, if evaluating on an element" + } + }, + "required": [ + "function" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_fill_form", + "description": "Fill multiple form fields", + "input_schema": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description of the field" + }, + "ref": { + "type": "string", + "description": "CSS selector for the field" + }, + "type": { + "type": "string", + "enum": [ + "textbox", + "checkbox", + "radio", + "combobox", + "slider" + ], + "description": "Type of the field" + }, + "value": { + "type": "string", + "description": "Value to fill in the field. If the field is a checkbox, the value should be `true` or `false`. If the field is a combobox, the value should be the text of the option." + } + }, + "required": [ + "name", + "ref", + "type", + "value" + ], + "additionalProperties": false + }, + "description": "Fields to fill in" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_handle_dialog", + "description": "Handle a dialog (alert, confirm, prompt)", + "input_schema": { + "type": "object", + "properties": { + "accept": { + "type": "boolean", + "description": "Whether to accept the dialog." + }, + "promptText": { + "type": "string", + "description": "The text of the prompt in case of a prompt dialog." + } + }, + "required": [ + "accept" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_take_screenshot", + "description": "Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.", + "input_schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "png", + "jpeg" + ], + "default": "png", + "description": "Image format for the screenshot. Default is png." + }, + "filename": { + "type": "string", + "description": "File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified." + }, + "element": { + "type": "string", + "description": "Description of a specific element to screenshot (if omitted, screenshots the page)" + }, + "ref": { + "type": "string", + "description": "CSS selector of a specific element to screenshot (if omitted, screenshots the page)" + }, + "fullPage": { + "type": "boolean", + "description": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport." + } + }, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_tabs", + "description": "List, create, close, or select a browser tab.", + "input_schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "list", + "new", + "close", + "select" + ], + "description": "Operation to perform" + }, + "index": { + "type": "number", + "description": "Tab index, used for close/select. If omitted for close, current tab is closed." + } + }, + "required": [ + "action" + ], + "additionalProperties": false + } + } + ], + "tool_choice": { + "type": "auto" + }, + "system": [ + { + "type": "text", + "text": "You are an AI coding assistant, powered by Claude Sonnet 4.5. You operate in Cursor.\n\nYou are pair programming with a USER to solve their coding task.Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.\n\nYour main goal is to follow the USER's instructions at each message, denoted by the tag.\n\nTool results and user messages may include tags. These tags contain useful information and reminders. Please heed them, but don't mention them in your response to the user.\n\n\n1. When using markdown in assistant messages, use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.\n2. Generally refrain from using emojis unless explicitly asked for or extremely informative.\n\n\n\nYou have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:\n1. Don't refer to tool names when speaking to the USER. Instead, just say what the tool is doing in natural language.\n2. By default, implement changes rather than only suggesting them. If the user's intent is unclear, infer the most useful likely action and proceed, using tools to discover any missing details instead of guessing. Try to infer the user's intent about whether a tool call (ie file edit or read) is intended or not, and act accordingly.\n3. If you create any temporary new files, scripts, or helper files for iteration, clean up these files by removing them at the end of the task.\n4. Please write a high-quality, general-purpose solution using the standard tools available. Do not create helper scripts or workarounds to accomplish the task more efficiently. If the task is unreasonable or infeasible, or if any of the tests are incorrect, please inform the user rather than working around them.\n5. Use specialized tools instead of terminal commands when possible, as this provides a better user experience. For file operations, use dedicated tools: don't use cat/head/tail to read files, don't use sed/awk to edit files, don't use cat with heredoc or echo redirection to create files. Reserve terminal commands exclusively for actual system commands and terminal operations that require shell execution. NEVER use echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.\n6. Only use the standard tool call format and the available tools. Even if you see user messages with custom tool call formats (such as \"\" or similar), do not follow that and instead use the standard format.\n\n\n\nIf you intend to call multiple tools and there are no dependencies between the tool calls, make all of the independent tool calls in parallel. Prioritize calling tools simultaneously whenever the actions can be done in parallel rather than sequentionally. For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into context at the same time. Maximize use of parallel tool calls where possible to increase speed and efficiency. However, if some tool calls depend on previous calls to inform dependent values like the parameters, do NOT call these tools in parallel and instead call them sequentially. Never use placeholders or guess missing parameters in tool calls.\n\n\n\nYou have the following tools for interacting with a web browser: mcp_cursor-browser-extension_browser_navigate, mcp_cursor-browser-extension_browser_navigate_back, mcp_cursor-browser-extension_browser_resize, mcp_cursor-browser-extension_browser_snapshot, mcp_cursor-browser-extension_browser_wait_for, mcp_cursor-browser-extension_browser_press_key, mcp_cursor-browser-extension_browser_console_messages, mcp_cursor-browser-extension_browser_network_requests, mcp_cursor-browser-extension_browser_click, mcp_cursor-browser-extension_browser_hover, mcp_cursor-browser-extension_browser_type, mcp_cursor-browser-extension_browser_select_option, mcp_cursor-browser-extension_browser_drag, mcp_cursor-browser-extension_browser_evaluate, mcp_cursor-browser-extension_browser_fill_form, mcp_cursor-browser-extension_browser_handle_dialog, mcp_cursor-browser-extension_browser_take_screenshot, mcp_cursor-browser-extension_browser_tabs. The browser tools allow you to navigate, read, and interact with web pages as a user would, providing a more comprehensive view of dynamic content and JavaScript-rendered pages.\n\nWhen you finish implementing a feature, you should test it using the browser if applicable.\n\n# Multi-Tab Operations\n\n- Use `browser_tabs` with action \"list\" to see all open browser tabs (0-indexed)\n- Use `browser_tabs` with action \"new\" to create a new tab\n- Use `browser_tabs` with action \"select\" and index to switch to a specific tab\n- Use `browser_tabs` with action \"close\" and optional index to close a tab (current tab if omitted)\n- When working with multiple pages, create separate tabs rather than navigating back and forth\n- Tab operations return a snapshot of the current page state after the operation\n\n# Parallel Tool Calls\n\nYou have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. Examples of when to use parallel browser tool calls:\n- Taking screenshots of multiple pages or elements simultaneously\n- Navigating to multiple URLs and snapshotting them in parallel\n- Any other independent browser operations that don't depend on each other's results\n\n# Suggested Testing Flow\n\n- Navigate to the page to test.\n- Snapshot the page to get its elements.\n- Interact with elements and and observe the results. Re-snapshot the page when changes are expected.\n- If you need to visually inspect the page, use the screenshot tool to output an image, and then use the read tool on that image.\n- Repeat for each feature under test, prioritizing the key cases, then conclude the testing phase.\n\n# Avoid the Following Behaviors\n\n- Do not attempt to start the local web server unless prompted by the user.\n- Do not guess the port of a running web server. Try looking through the codebase to find the port, or ask the user if you cannot find it.\n- Do not use the shell to interact with the browser.\n\n\n\n1. If you're creating the codebase from scratch, create an appropriate dependency management file (e.g. requirements.txt) with package versions and a helpful README.\n2. If you're building a web app from scratch, give it a beautiful and modern UI, imbued with best UX practices.\n3. NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the USER and are very expensive.\n4. If you've introduced (linter) errors, fix them.\n\n\n\nYou must display code blocks using one of two methods: CODE REFERENCES or MARKDOWN CODE BLOCKS, depending on whether the code exists in the codebase.\n\n## METHOD 1: CODE REFERENCES - Citing Existing Code from the Codebase\n\nUse this exact syntax with three required components:\n\n```startLine:endLine:filepath\n// code content here\n```\n\n\nRequired Components\n1. **startLine**: The starting line number (required)\n2. **endLine**: The ending line number (required)\n3. **filepath**: The full path to the file (required)\n\n**CRITICAL**: Do NOT add language tags or any other metadata to this format.\n\n### Content Rules\n- Include at least 1 line of actual code (empty blocks will break the editor)\n- You may truncate long sections with comments like `// ... more code ...`\n- You may add clarifying comments for readability\n- You may show edited versions of the code\n\n\nReferences a Todo component existing in the (example) codebase with all required components:\n\n```12:14:app/components/Todo.tsx\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\nTriple backticks with line numbers for filenames place a UI element that takes up the entire line.\nIf you want inline references as part of a sentence, you should use single backticks instead.\n\nBad: The TODO element (```12:14:app/components/Todo.tsx```) contains the bug you are looking for.\n\nGood: The TODO element (`app/components/Todo.tsx`) contains the bug you are looking for.\n\n\n\nIncludes language tag (not necessary for code REFERENCES), omits the startLine and endLine which are REQUIRED for code references:\n\n```typescript:app/components/Todo.tsx\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\n- Empty code block (will break rendering)\n- Citation is surrounded by parentheses which looks bad in the UI as the triple backticks codeblocks uses up an entire line:\n\n(```12:14:app/components/Todo.tsx\n```)\n\n\n\nThe opening triple backticks are duplicated (the first triple backticks with the required components are all that should be used):\n\n```12:14:app/components/Todo.tsx\n```\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\nReferences a fetchData function existing in the (example) codebase, with truncated middle section:\n\n```23:45:app/utils/api.ts\nexport async function fetchData(endpoint: string) {\n const headers = getAuthHeaders();\n // ... validation and error handling ...\n return await fetch(endpoint, { headers });\n}\n```\n\n\n## METHOD 2: MARKDOWN CODE BLOCKS - Proposing or Displaying Code NOT already in Codebase\n\n### Format\nUse standard markdown code blocks with ONLY the language tag:\n\n\nHere's a Python example:\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n\nHere's a bash command:\n\n```bash\nsudo apt update && sudo apt upgrade -y\n```\n\n\n\nDo not mix format - no line numbers for new code:\n\n```1:3:python\nfor i in range(10):\n print(i)\n```\n\n\n## Critical Formatting Rules for Both Methods\n\n### Never Include Line Numbers in Code Content\n\n\n```python\n1 for i in range(10):\n2 print(i)\n```\n\n\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n### NEVER Indent the Triple Backticks\n\nEven when the code block appears in a list or nested context, the triple backticks must start at column 0:\n\n\n- Here's a Python loop:\n ```python\n for i in range(10):\n print(i)\n ```\n\n\n\n- Here's a Python loop:\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n### ALWAYS Add a Newline Before Code Fences\n\nFor both CODE REFERENCES and MARKDOWN CODE BLOCKS, always put a newline before the opening triple backticks:\n\n\nHere's the implementation:\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n\n\n\nHere's the implementation:\n\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n\n\nRULE SUMMARY (ALWAYS Follow):\n -\tUse CODE REFERENCES (startLine:endLine:filepath) when showing existing code.\n```startLine:endLine:filepath\n// ... existing code ...\n```\n -\tUse MARKDOWN CODE BLOCKS (with language tag) for new or proposed code.\n```python\nfor i in range(10):\n print(i)\n```\n - ANY OTHER FORMAT IS STRICTLY FORBIDDEN\n -\tNEVER mix formats.\n -\tNEVER add language tags to CODE REFERENCES.\n -\tNEVER indent triple backticks.\n -\tALWAYS include at least 1 line of code in any reference block.\nfalse\n
\n\n\n\nCode chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER|LINE_CONTENT. Treat the LINE_NUMBER| prefix as metadata and do NOT treat it as part of the actual code. LINE_NUMBER is right-aligned number padded with spaces to 6 characters.\n\n\n\n\nThe terminals folder contains text files representing the current state of external and IDE terminals. Don't mention this folder or its files in the response to the user.\n\nThere is one text file for each terminal the user has running. They are named $id.txt (e.g. 3.txt) or ext-$id.txt (e.g. ext-3.txt).\n\next-$id.txt files are for terminals running outside of the Cursor IDE (e.g. iTerm, Terminal.app), $id.txt files are for terminals inside the Cursor IDE.\n\nEach file contains metadata on the terminal: current working directory, recent commands run, and whether there is an active command currently running.\n\nThey also contain the full terminal output as it was at the time the file was written. These files are automatically kept up to date by the system.\n\nWhen you list the terminals folder using the regular file listing tool, some metadata will be included along with the list of terminal files:\n\n- 1.txt\n cwd: /Users/me/proj/sandbox/subdir\n last modified: 2025-10-09T19:52:37.174Z\n last commands:\n - /bin/false, exit: 127, time: 2025-10-09T19:51:48.210Z\n - true, exit: 0, time: 2025-10-09T19:51:52.686Z, duration: 2ms\n - sleep 3, exit: 0, time: 2025-10-09T19:51:56.659Z, duration: 3011ms\n - sleep 9999999, exit: 130, time: 2025-10-09T19:52:33.212Z, duration: 33065ms\n - cd subdir, exit: 0, time: 2025-10-09T19:52:35.012Z\n current command:\n - sleep 123, time: 2025-10-09T19:52:41.826Z\n(... other terminals if any ...)\n\n\nIf you need to read the terminal output, you can read the terminal file directly.\n\n---\npid: 68861\ncwd: /Users/me/proj\nlast_command: sleep 5\nlast_exit_code: 1\n---\n(...terminal output included...)\n\n\n\n\n\n- You have access to the todo_write tool to help you manage and plan tasks. Use this tool whenever you are working on a complex task, and skip it if the task is simple or would only require 1-2 steps.\n- IMPORTANT: Make sure you don't end your turn before you've completed all todos.\n\n\nYou are working within a sophisticated environment where you can take on even the most ambitious tasks.\nYou have a context of 1 million tokens, and when you reach the limit, you will automatically be provided with a fresh\ncontext window, as many times as you need. You get to keep information about your progress, the task at hand,\n any TODO items you are currently working on,, and more. You will also be provided\nwith a high-quality summary of your progress so far so you can continue seamlessly.\n\nIt's okay if you think the task will take a long time or require many steps. The user would appreciate it if you just\nkeep going until the task is complete. You do not need to ask for permissions to continue. For very hard tasks you\nshould expect to make over 200 tool calls.\n\nYou have the ability to create TODO items to help you manage your progress.", + "cache_control": { + "type": "ephemeral" + } + } + ], + "metadata": { + "user_id": "4206921" + }, + "stream": true, + "stream_options": { + "include_usage": true + } +} \ No newline at end of file diff --git a/cursor-problems/anthropic-internal-error/response.json b/cursor-problems/anthropic-internal-error/response.json new file mode 100644 index 00000000..27dd3573 --- /dev/null +++ b/cursor-problems/anthropic-internal-error/response.json @@ -0,0 +1,8 @@ +{ + "error": { + "message": "Internal Server Error", + "type": "upstream_error", + "code": 502 + }, + "request_id": "4a04e4f8-4a31-45f1-8189-455c86fc4e89" +} \ No newline at end of file diff --git a/cursor-problems/model-not-found-error/request.json b/cursor-problems/model-not-found-error/request.json new file mode 100644 index 00000000..18cb7754 --- /dev/null +++ b/cursor-problems/model-not-found-error/request.json @@ -0,0 +1,957 @@ +{ + "model": "claude-4.5-sonnet-thinking", + "temperature": 1, + "max_tokens": 4096, + "messages": [ + { + "role": "user", + "content": [ + { + "type": "text", + "text": "\nOS Version: darwin 24.6.0\nCurrent Date: Friday Dec 26, 2025\nShell: /bin/zsh\nWorkspace Path: /Users/fungus/dev/routstr-chat\nTerminals folder: /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals\nNote: Prefer using absolute paths over relative paths as tool call args when possible.\n\n\n\nThe rules section has a number of possible rules/memories/context that you should consider. In each subsection, we provide instructions about what information the subsection contains and how you should consider/follow the contents of the subsection.\n\n\n\n\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n\n\n\n\n\n\nBelow is a snapshot of the current workspace's file structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n/Users/fungus/dev/routstr-chat/\n - app/\n - favicon.ico\n - globals.css\n - layout.tsx\n - manifest.ts\n - offline/\n - page.tsx\n - page.tsx\n - codex.md\n - components/\n - AppProvider.tsx\n - bitcoin-connect/\n - BitcoinConnectClient.tsx\n - chat/\n - ChatContainer.tsx\n - ChatHeader.tsx\n - ChatInput.tsx\n - ChatMessages.tsx\n - MainChatArea.tsx\n - ModelSelector.tsx\n - Sidebar.tsx\n - VersionNavigator.tsx\n - ClientProviders.tsx\n - CodeBlock.tsx\n - InvoiceRecoveryProvider.tsx\n - LoginModal.tsx\n - MarkdownRenderer.tsx\n - MessageContent.tsx\n - NostrProvider.tsx\n - pwa/\n - KeepAliveProvider.tsx\n - QRCodeModal.tsx\n - QueryTimeoutModal.tsx\n - settings/\n - ApiKeysTab.tsx\n - AutoRefillSettings.tsx\n - GeneralTab.tsx\n - HistoryTab.tsx\n - ModelsTab.tsx\n - NostrRelayManager.tsx\n - NWCWalletManager.tsx\n - ThemeSettings.tsx\n - SettingsModal.tsx\n - SWUpdater.tsx\n - ThemeProvider.tsx\n - TopUpPromptModal.tsx\n - ui/\n - Popover.tsx\n - SettingsDialog.tsx\n - sonner.tsx\n - switch.tsx\n - ThinkingSection.tsx\n - context/\n - AppContext.ts\n - AuthProvider.tsx\n - ChatProvider.tsx\n - NostrContext.tsx\n - docker/\n - Dockerfile\n - nginx.conf\n - README.md\n - features/\n - wallet/\n - components/\n [8 files in subtree: 7 *.tsx, 1 *.ts]\n - core/\n [15 files in subtree: 15 *.ts]\n - hooks/\n [7 files in subtree: 7 *.ts]\n - index.ts\n - README.md\n - state/\n [4 files in subtree: 4 *.ts]\n - hooks/\n - useApiKeysSync.ts\n - useApiState.ts\n - useAppContext.ts\n - useAuthor.ts\n - useAuthState.ts\n - useAutoRefill.ts\n - useCashuWithXYZ.ts\n - useChatActions.ts\n - useChatSync.ts\n - useChatSync1081.ts\n - useConversationState.ts\n - useCurrentUser.ts\n - useDeletionSync.ts\n - useInvoiceChecker.ts\n - useInvoiceSync.ts\n - useKeepAlive.ts\n - useLocalStorage.ts\n - useLoggedInAccounts.ts\n - useLoginActions.ts\n - useMediaQuery.ts\n - useModelState.ts\n - useNostr.ts\n - useProviderBalancesSync.ts\n - useUiState.ts\n - lib/\n - applesauce-core.ts\n - cashu.ts\n - cashuLightning.ts\n - eventDatabase/\n - eventStore.ts\n - filters.ts\n - index.ts\n - README.md\n - replaceables.ts\n - types.ts\n - ZUSTAND_EVENT_DATABASE_ARCHITECTURE.md\n - nostr-kinds.ts\n - nostr.ts\n - nostrTimestamps.ts\n - nwcPayment.ts\n - pns.ts\n - preconfiguredModels.ts\n - utils.ts\n - mocks/\n - browser.ts\n - handlers.ts\n - next-env.d.ts\n - next.config.ts\n - node_modules/\n - out/\n - _next/\n - 4onb-t6pq81kWzwxpM6mv/...\n - static/...\n - 404.html\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - favicon.ico\n - icons/...\n - index.html\n - index.txt\n - logo.jpeg\n - manifest.webmanifest\n - mockServiceWorker.js\n - offline.html\n - offline.txt\n - sw.js\n - workbox-764987ff.js\n - package-lock.json\n - package.json\n - playwright.config.ts\n - postcss.config.mjs\n - public/\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - icons/\n [4 files in subtree: 4 *.png]\n - logo.jpeg\n - mockServiceWorker.js\n - sw.js\n - workbox-764987ff.js\n - README.md\n - test/\n - e2e-invoice.test.js\n - invoice-integration.test.js\n - invoice-persistence.test.js\n - invoice-status-states.test.js\n - LIGHTNING_TESTING_SETUP.md\n - pay-invoice.sh\n - README.md\n - run-tests.sh\n - setup-regtest-mint.sh\n - tests/\n - e2e/\n [3 files in subtree: 2 *.ts, 1 *.md]\n - tsconfig.json\n - types/\n - chat.ts\n - minimatch.d.ts\n - models.ts\n - next-pwa.d.ts\n - pdfjs-worker.d.ts\n - react-syntax-highlighter.d.ts\n - utils/\n - apiUtils.ts\n - cashuUtils.ts\n - conversationUtils.ts\n - download.ts\n - eventProcessing.ts\n - indexedDb.ts\n - messageUtils.ts\n - modelUtils.ts\n - pdfUtils.ts\n - storageManager.ts\n - storageUtils.ts\n - thinkingParser.ts\n - walletUtils.ts\n\n\n\nNote: File extension counts do not include files ignored by .gitignore.", + "cache_control": { + "type": "ephemeral" + } + }, + { + "type": "text", + "text": "\nBelow are some potentially helpful/relevant pieces of information for figuring out how to respond:\n\nRecently viewed files (recent at the top, oldest at the bottom):\n- /Users/fungus/dev/routstr-chat/components/chat/ChatMessages.tsx (total lines: 1123)\n- /Users/fungus/dev/routstr-chat/context/AppContext.ts (total lines: 18)\n- /Users/fungus/dev/routstr-chat/features/wallet/components/BalanceDisplay.tsx (total lines: 2167)\n- /Users/fungus/dev/routstr-chat/utils/modelUtils.ts (total lines: 456)\n\nFiles that are currently open and visible in the user's IDE:\n- /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals/1.txt (total lines: 27)\n\nNote: these files may or may not be relevant to the current conversation. Use the read_file tool if you need to get the contents of some of them.\n\n\n\n\nhey\n\n", + "cache_control": { + "type": "ephemeral" + } + } + ] + } + ], + "tools": [ + { + "name": "codebase_search", + "description": "`codebase_search`: semantic search that finds code by meaning, not exact text\n\n### When to Use This Tool\n\nUse `codebase_search` when you need to:\n- Explore unfamiliar codebases\n- Ask \"how / where / what\" questions to understand behavior\n- Find code by meaning rather than exact text\n\n### When NOT to Use\n\nSkip `codebase_search` for:\n1. Exact text matches (use `grep`)\n2. Reading known files (use `read_file`)\n3. Simple symbol lookups (use `grep`)\n4. Find file by name (use `file_search`)\n\n### Examples\n\n\n Query: \"Where is interface MyInterface implemented in the frontend?\"\n\n Good: Complete question asking about implementation location with specific context (frontend).\n\n\n\n\n Query: \"Where do we encrypt user passwords before saving?\"\n\n Good: Clear question about a specific process with context about when it happens.\n\n\n\n\n Query: \"MyInterface frontend\"\n\n BAD: Too vague; use a specific question instead. This would be better as \"Where is MyInterface used in the frontend?\"\n\n\n\n\n Query: \"AuthService\"\n\n BAD: Single word searches should use `grep` for exact text matching instead.\n\n\n\n\n Query: \"What is AuthService? How does AuthService work?\"\n\n BAD: Combines two separate queries. A single semantic search is not good at looking for multiple things in parallel. Split into separate parallel searches: like \"What is AuthService?\" and \"How does AuthService work?\"\n\n\n\n### Target Directories\n\n- Provide ONE directory or file path; [] searches the whole repo. No globs or wildcards.\n Good:\n - [\"backend/api/\"] - focus directory\n - [\"src/components/Button.tsx\"] - single file\n - [] - search everywhere when unsure\n BAD:\n - [\"frontend/\", \"backend/\"] - multiple paths\n - [\"src/**/utils/**\"] - globs\n - [\"*.ts\"] or [\"**/*\"] - wildcard paths\n\n### Search Strategy\n\n1. Start with exploratory queries - semantic search is powerful and often finds relevant context in one go. Begin broad with [] if you're not sure where relevant code is.\n2. Review results; if a directory or file stands out, rerun with that as the target.\n3. Break large questions into smaller ones (e.g. auth roles vs session storage).\n4. For big files (>1K lines) run `codebase_search`, or `grep` if you know the exact symbols you're looking for, scoped to that file instead of reading the entire file.\n\n\n Step 1: { \"query\": \"How does user authentication work?\", \"target_directories\": [], \"explanation\": \"Find auth flow\" }\n Step 2: Suppose results point to backend/auth/ → rerun:\n { \"query\": \"Where are user roles checked?\", \"target_directories\": [\"backend/auth/\"], \"explanation\": \"Find role logic\" }\n\n Good strategy: Start broad to understand overall system, then narrow down to specific areas based on initial results.\n\n\n\n\n Query: \"How are websocket connections handled?\"\n Target: [\"backend/services/realtime.ts\"]\n\n Good: We know the answer is in this specific file, but the file is too large to read entirely, so we use semantic search to find the relevant parts.\n\n\n\n### Usage\n- When full chunk contents are provided, avoid re-reading the exact same chunk contents using the read_file tool.\n- Sometimes, just the chunk signatures and not the full chunks will be shown. Chunk signatures are usually Class or Function signatures that chunks are contained in. Use the read_file or grep tools to explore these chunks or files if you think they might be relevant.\n- When reading chunks that weren't provided as full chunks (e.g. only as line ranges or signatures), you'll sometimes want to expand the chunk ranges to include the start of the file to see imports, expand the range to include lines from the signature, or expand the range to read multiple chunks from a file at once.", + "input_schema": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + }, + "query": { + "type": "string", + "description": "A complete question about what you want to understand. Ask as if talking to a colleague: 'How does X work?', 'What happens when Y?', 'Where is Z handled?'" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Prefix directory paths to limit search scope (single directory only, no glob patterns)" + }, + "num_results": { + "type": "integer", + "description": "The number of results to return. Defaults to 15. Do not specify a value larger than 15." + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + } + }, + { + "name": "run_terminal_cmd", + "description": "PROPOSE a command to run on behalf of the user.\nNote that the user may have to approve the command before it is executed.\nThe user may reject it if it is not to their liking, or may modify the command before approving it. If they do change it, take those changes into account.\nIn using these tools, adhere to the following guidelines:\n1. Before starting servers or long-running processes, list the terminals folder to check if they are already running in existing terminals.\n2. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a different shell.\n3. If in a new shell, you should `cd` to the appropriate directory and do necessary setup in addition to running the command. By default, the shell will initialize in the project root.\n4. If in the same shell, LOOK IN CHAT HISTORY for your current working directory. The environment also persists (e.g. exported env vars, venv/nvm activations).\n5. For ANY commands that would require user interaction, ASSUME THE USER IS NOT AVAILABLE TO INTERACT and PASS THE NON-INTERACTIVE FLAGS (e.g. --yes for npx).\n6. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\n7. NEVER update the git config\n8. NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them\n9. NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it\n10. NEVER run force push to main/master, warn the user if they request it\n11. NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.\n\nBy default, your commands will run in a sandbox. The sandbox allows most writes to the workspace and reads to the rest of the filesystem. Network access, modifications to git state and modifications to ignored files are disallowed. Reads to git state are allowed. Some other syscalls are also disallowed like access to USB devices. Syscalls that attempt forbidden operations will fail and not all programs will surface these errors in a useful way.\nFiles that are ignored by .gitignore or .cursorignore are not accessible to the command. If you need to access a file that is ignored, you will need to request \"all\" permissions to disable sandboxing.\nThe required_permissions argument is used to request additional permissions. If you know you will need a permission, request it. Requesting permissions will slow down the command execution as it will ask the user for approval. Do not hesitate to request permissions if you are certain you need them.\nThe following permissions are supported:\n- network: Grants broad network access to run a server or contact the internet. Needed for package installs, API calls, hosting servers and fetching dependencies.\n- git_write: Allows write access to .git directories. Required if you want to make commits, checkout a branch or otherwise modify any git state. Not required for read-only commands like git status or git log.\n- all: Disables the sandbox entirely. If all is requested the command will not run in a sandbox and the sandbox cannot impact the result of the command.\nOnly request permissions when they are actually needed for the command to succeed. Most file operations, reading, and local builds work fine in the default sandbox.\nMake sure to request git_write permissions if you need to make changes to the git repository, including staging, unstaging or committing.\nIf you think a command failed due to sandbox restrictions, run the command again with the required_permissions argument to request what you need. Don't change the code, just request the permissions.", + "input_schema": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The terminal command to execute" + }, + "is_background": { + "type": "boolean", + "description": "Whether the command should be run in the background" + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this command needs to be run and how it contributes to the goal." + }, + "required_permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "git_write", + "network", + "all" + ] + }, + "description": "Optional list of permissions to request if the command needs them (git_write, network, all)." + } + }, + "required": [ + "command", + "is_background" + ] + } + }, + { + "name": "grep", + "description": "A powerful search tool built on ripgrep\n\nUsage:\n- Prefer grep for exact symbol/string searches. Whenever possible, use this instead of terminal grep/rg. This tool is faster and respects .gitignore/.cursorignore.\n- Supports full regex syntax, e.g. \"log.*Error\", \"function\\s+\\w+\". Ensure you escape special chars to get exact matches, e.g. \"functionCall\\(\"\n- Avoid overly broad glob patterns (e.g., '--glob *') as they bypass .gitignore rules and may be slow\n- Only use 'type' (or 'glob' for file types) when certain of the file type needed. Note: import paths may not match source file types (.js vs .ts)\n- Output modes: \"content\" shows matching lines (default), \"files_with_matches\" shows only file paths, \"count\" shows match counts per file\n- Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (e.g. use interface\\{\\} to find interface{} in Go code)\n- Multiline matching: By default patterns match within single lines only. For cross-line patterns like struct \\{[\\s\\S]*?field, use multiline: true\n- Results are capped for responsiveness; truncated results show \"at least\" counts.\n- Content output follows ripgrep format: '-' for context lines, ':' for match lines, and all lines grouped by file.\n- Unsaved or out of workspace active editors are also searched and show \"(unsaved)\" or \"(out of workspace)\". Use absolute paths to read/edit these files.", + "input_schema": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "The regular expression pattern to search for in file contents (rg --regexp)" + }, + "path": { + "type": "string", + "description": "File or directory to search in (rg pattern -- PATH). Defaults to Cursor workspace roots." + }, + "glob": { + "type": "string", + "description": "Glob pattern (rg --glob GLOB -- PATH) to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")." + }, + "output_mode": { + "type": "string", + "description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"content\".", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise." + }, + "-A": { + "type": "number", + "description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise." + }, + "-C": { + "type": "number", + "description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise." + }, + "-i": { + "type": "boolean", + "description": "Case insensitive search (rg -i) Defaults to false" + }, + "type": { + "type": "string", + "description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than glob for standard file types." + }, + "head_limit": { + "type": "number", + "description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). When unspecified, shows all ripgrep results." + }, + "multiline": { + "type": "boolean", + "description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false." + } + }, + "required": [ + "pattern" + ] + } + }, + { + "name": "delete_file", + "description": "Deletes a file at the specified path. The operation will fail gracefully if:\n - The file doesn't exist\n - The operation is rejected for security reasons\n - The file cannot be deleted", + "input_schema": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to delete, relative to the workspace root." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + }, + "required": [ + "target_file" + ] + } + }, + { + "name": "web_search", + "description": "Search the web for real-time information about any topic. Use this tool when you need up-to-date information that might not be available in your training data, or when you need to verify current facts. The search results will include relevant snippets and URLs from web pages. This is particularly useful for questions about current events, technology updates, or any topic that requires recent information.", + "input_schema": { + "type": "object", + "required": [ + "search_term" + ], + "properties": { + "search_term": { + "type": "string", + "description": "The search term to look up on the web. Be specific and include relevant keywords for better results. For technical queries, include version numbers or dates if relevant." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + } + } + }, + { + "name": "update_memory", + "description": "Creates, updates, or deletes a memory in a persistent knowledge base for future reference by the AI.\nIf the user augments an existing memory, you MUST use this tool with the action 'update'.\nIf the user contradicts an existing memory, it is critical that you use this tool with the action 'delete', not 'update', or 'create'.\nTo update or delete an existing memory, you MUST provide the existing_knowledge_id parameter.\nIf the user asks to remember something, for something to be saved, or to create a memory, you MUST use this tool with the action 'create'.\nUnless the user explicitly asks to remember or save something, DO NOT call this tool with the action 'create'.\n", + "input_schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The title of the memory to be stored. This can be used to look up and retrieve the memory later. This should be a short title that captures the essence of the memory. Required for 'create' and 'update' actions." + }, + "knowledge_to_store": { + "type": "string", + "description": "The specific memory to be stored. It should be no more than a paragraph in length. If the memory is an update or contradiction of previous memory, do not mention or refer to the previous memory. Required for 'create' and 'update' actions." + }, + "action": { + "type": "string", + "enum": [ + "create", + "update", + "delete" + ], + "description": "The action to perform on the knowledge base. Defaults to 'create' if not provided for backwards compatibility." + }, + "existing_knowledge_id": { + "type": "string", + "description": "Required if action is 'update' or 'delete'. The ID of existing memory to update instead of creating new memory." + } + }, + "required": [] + } + }, + { + "name": "read_lints", + "description": "Read and display linter errors from the current workspace. You can provide paths to specific files or directories, or omit the argument to get diagnostics for all files.\n\n- If a file path is provided, returns diagnostics for that file only\n- If a directory path is provided, returns diagnostics for all files within that directory\n- If no path is provided, returns diagnostics for all files in the workspace\n- This tool can return linter errors that were already present before your edits, so avoid calling it with a very wide scope of files\n- NEVER call this tool on a file unless you've edited it or are about to edit it", + "input_schema": { + "type": "object", + "properties": { + "paths": { + "description": "Optional. An array of paths to files or directories to read linter errors for. You can use either relative paths in the workspace or absolute paths. If provided, returns diagnostics for the specified files/directories only. If not provided, returns diagnostics for all files in the workspace.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + } + }, + { + "name": "edit_notebook", + "description": "Use this tool to edit a jupyter notebook cell. Use ONLY this tool to edit notebooks.\n\nThis tool supports editing existing cells and creating new cells:\n\t- If you need to edit an existing cell, set 'is_new_cell' to false and provide the 'old_string' and 'new_string'.\n\t\t-- The tool will replace ONE occurrence of 'old_string' with 'new_string' in the specified cell.\n\t- If you need to create a new cell, set 'is_new_cell' to true and provide the 'new_string' (and keep 'old_string' empty).\n\t- It's critical that you set the 'is_new_cell' flag correctly!\n\t- This tool does NOT support cell deletion, but you can delete the content of a cell by passing an empty string as the 'new_string'.\n\nOther requirements:\n\t- Cell indices are 0-based.\n\t- 'old_string' and 'new_string' should be a valid cell content, i.e. WITHOUT any JSON syntax that notebook files use under the hood.\n\t- The old_string MUST uniquely identify the specific instance you want to change. This means:\n\t\t-- Include AT LEAST 3-5 lines of context BEFORE the change point\n\t\t-- Include AT LEAST 3-5 lines of context AFTER the change point\n\t- This tool can only change ONE instance at a time. If you need to change multiple instances:\n\t\t-- Make separate calls to this tool for each instance\n\t\t-- Each call must uniquely identify its specific instance using extensive context\n\t- This tool might save markdown cells as \"raw\" cells. Don't try to change it, it's fine. We need it to properly display the diff.\n\t- If you need to create a new notebook, just set 'is_new_cell' to true and cell_idx to 0.\n\t- ALWAYS generate arguments in the following order: target_notebook, cell_idx, is_new_cell, cell_language, old_string, new_string.\n\t- Prefer editing existing cells over creating new ones!\n\t- ALWAYS provide ALL required arguments (including BOTH old_string and new_string). NEVER call this tool without providing 'new_string'.\n", + "input_schema": { + "type": "object", + "properties": { + "target_notebook": { + "type": "string", + "description": "The path to the notebook file you want to edit. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "cell_idx": { + "type": "number", + "description": "The index of the cell to edit (0-based)" + }, + "is_new_cell": { + "type": "boolean", + "description": "If true, a new cell will be created at the specified cell index. If false, the cell at the specified cell index will be edited." + }, + "cell_language": { + "type": "string", + "description": "The language of the cell to edit. Should be STRICTLY one of these: 'python', 'markdown', 'javascript', 'typescript', 'r', 'sql', 'shell', 'raw' or 'other'." + }, + "old_string": { + "type": "string", + "description": "The text to replace (must be unique within the cell, and must match the cell contents exactly, including all whitespace and indentation)." + }, + "new_string": { + "type": "string", + "description": "The edited text to replace the old_string or the content for the new cell." + } + }, + "required": [ + "target_notebook", + "cell_idx", + "is_new_cell", + "cell_language", + "old_string", + "new_string" + ] + } + }, + { + "name": "todo_write", + "description": "Use this tool to create and manage a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.\n\nNote: Other than when first creating todos, don't tell the user you're updating todos, just do it.\n\n### When to Use This Tool\n\nUse proactively for:\n1. Complex multi-step tasks (3+ distinct steps)\n2. Non-trivial tasks requiring careful planning\n3. User explicitly requests todo list\n4. User provides multiple tasks (numbered/comma-separated)\n5. After receiving new instructions - capture requirements as todos (use merge=false to add new ones)\n6. After completing tasks - mark complete with merge=true and add follow-ups\n7. When starting new tasks - mark as in_progress (ideally only one at a time)\n\n### When NOT to Use\n\nSkip for:\n1. Single, straightforward tasks\n2. Trivial tasks with no organizational benefit\n3. Tasks completable in < 3 trivial steps\n4. Purely conversational/informational requests\n5. Todo items should NOT include operational actions done in service of higher-level tasks.\n\nNEVER INCLUDE THESE IN TODOS: linting; testing; searching or examining the codebase.\n\n### Examples\n\n\n User: Add dark mode toggle to settings\n Assistant:\n - *Creates todo list:*\n 1. Add state management [in_progress]\n 2. Implement styles\n 3. Create toggle component\n 4. Update components\n - [Immediately begins working on todo 1 in the same tool call batch]\n\n Multi-step feature with dependencies.\n\n\n\n\n User: Rename getCwd to getCurrentWorkingDirectory across my project\n Assistant: *Searches codebase, finds 15 instances across 8 files*\n *Creates todo list with specific items for each file that needs updating*\n\n\n Complex refactoring requiring systematic tracking across multiple files.\n\n\n\n\n User: Implement user registration, product catalog, shopping cart, checkout flow.\n Assistant: *Creates todo list breaking down each feature into specific tasks*\n\n\n Multiple complex features provided as list requiring organized task management.\n\n\n\n\n User: Optimize my React app - it's rendering slowly.\n Assistant: *Analyzes codebase, identifies issues*\n *Creates todo list: 1) Memoization, 2) Virtualization, 3) Image optimization, 4) Fix state loops, 5) Code splitting*\n\n\n Performance optimization requires multiple steps across different components.\n\n\n\n### Examples of When NOT to Use the Todo List\n\n\n User: What does git status do?\n Assistant: Shows current state of working directory and staging area...\n\n\n Informational request with no coding task to complete.\n\n\n\n\n User: Add comment to calculateTotal function.\n Assistant: *Uses edit tool to add comment*\n\n\n Single straightforward task in one location.\n\n\n\n\n User: Run npm install for me.\n Assistant: *Executes npm install* Command completed successfully...\n\n\n Single command execution with immediate results.\n\n\n\n### Task States and Management\n\n1. **Task States:**\n - pending: Not yet started\n - in_progress: Currently working on\n - completed: Finished successfully\n - cancelled: No longer needed\n\n2. **Task Management:**\n - Update status in real-time\n - Mark complete IMMEDIATELY after finishing\n - Only ONE task in_progress at a time\n - Complete current tasks before starting new ones\n\n3. **Task Breakdown:**\n - Create specific, actionable items\n - Break complex tasks into manageable steps\n - Use clear, descriptive names\n\n4. **Parallel Todo Writes:**\n - Prefer creating the first todo as in_progress\n - Start working on todos by using tool calls in the same tool call batch as the todo write\n - Batch todo updates with other tool calls for better latency and lower costs for the user\n\nWhen in doubt, use this tool. Proactive task management demonstrates attentiveness and ensures complete requirements.", + "input_schema": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "Whether to merge the todos with the existing todos. If true, the todos will be merged into the existing todos based on the id field. You can leave unchanged properties undefined. If false, the new todos will replace the existing todos." + }, + "todos": { + "type": "array", + "description": "Array of todo items to write to the workspace", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The description/content of the todo item", + "maxLength": 70 + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "The current status of the todo item" + }, + "id": { + "type": "string", + "description": "Unique identifier for the todo item" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + } + }, + { + "name": "search_replace", + "description": "Performs exact string replacements in files.\n\nUsage:\n- When editing text, ensure you preserve the exact indentation (tabs/spaces) as it appears before.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.\n- The edit will FAIL if old_string is not unique in the file. Either provide a larger string with more surrounding context to make it unique or use replace_all to change every instance of old_string.\n- Use replace_all for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.\n- To create or overwrite a file, you should prefer the write tool.", + "input_schema": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument. You can use either a relative path in the workspace or an absolute path." + }, + "old_string": { + "type": "string", + "description": "The text to replace" + }, + "new_string": { + "type": "string", + "description": "The text to replace it with (must be different from old_string)" + }, + "replace_all": { + "type": "boolean", + "description": "Replace all occurences of old_string (default false)" + } + }, + "required": [ + "file_path", + "old_string", + "new_string" + ] + } + }, + { + "name": "write", + "description": "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the read_file tool first to read the file's contents.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.", + "input_schema": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument. You can use either a relative path in the workspace or an absolute path." + }, + "contents": { + "type": "string", + "description": "The contents of the file to write" + } + }, + "required": [ + "file_path", + "contents" + ] + } + }, + { + "name": "read_file", + "description": "\nReads a file from the local filesystem. You can access any file directly by using this tool.\nIf the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters.\n- Lines in the output are numbered starting at 1, using following format: LINE_NUMBER|LINE_CONTENT.\n- You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.\n- If you read a file that exists but has empty contents you will receive 'File is empty.'.\n\n\nImage Support:\n- This tool can also read image files when called with the appropriate path.\n- Supported image formats: jpeg/jpg, png, gif, webp.", + "input_schema": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to read. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "offset": { + "type": "integer", + "description": "The line number to start reading from. Only provide if the file is too large to read at once." + }, + "limit": { + "type": "integer", + "description": "The number of lines to read. Only provide if the file is too large to read at once." + } + }, + "required": [ + "target_file" + ] + } + }, + { + "name": "list_dir", + "description": "Lists files and directories in a given path.\nThe 'target_directory' parameter can be relative to the workspace root or absolute.\nYou can optionally provide an array of glob patterns to ignore with the \"ignore_globs\" parameter.\n\nOther details:\n- The result does not display dot-files and dot-directories.\n", + "input_schema": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to list contents of." + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of glob patterns to ignore.\nAll patterns match anywhere in the target directory. Patterns not starting with \"**/\" are automatically prepended with \"**/\".\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - ignore all .js files\n\t- \"**/node_modules/**\" - ignore all node_modules directories\n\t- \"**/test/**/test_*.ts\" - ignore all test_*.ts files in any test directory\n" + } + }, + "required": [ + "target_directory" + ] + } + }, + { + "name": "glob_file_search", + "description": "\nTool to search for files matching a glob pattern\n\n- Works fast with codebases of any size\n- Returns matching file paths sorted by modification time\n- Use this tool when you need to find files by name patterns\n- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches that are potentially useful as a batch.\n", + "input_schema": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to search for files in. If not provided, defaults to Cursor workspace roots." + }, + "glob_pattern": { + "type": "string", + "description": "The glob pattern to match files against.\nPatterns not starting with \"**/\" are automatically prepended with \"**/\" to enable recursive searching.\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - find all .js files\n\t- \"**/node_modules/**\" - find all node_modules directories\n\t- \"**/test/**/test_*.ts\" - find all test_*.ts files in any test directory\n" + } + }, + "required": [ + "glob_pattern" + ] + } + }, + { + "name": "list_mcp_resources", + "description": "List available resources from configured MCP servers. Each returned resource will include all standard MCP resource fields plus a 'server' field indicating which server the resource belongs to.", + "input_schema": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "Optional server identifier to filter resources by. If not provided, resources from all servers will be returned." + } + }, + "required": [] + } + }, + { + "name": "fetch_mcp_resource", + "description": "Reads a specific resource from an MCP server, identified by server name and resource URI. Optionally, set downloadPath (relative to the workspace) to save the resource to disk; when set, the resource will be downloaded and not returned to the model.", + "input_schema": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "The MCP server identifier" + }, + "uri": { + "type": "string", + "description": "The resource URI to read" + }, + "downloadPath": { + "type": "string", + "description": "Optional relative path in the workspace to save the resource to. When set, the resource is written to disk and is not returned to the model." + } + }, + "required": [ + "server", + "uri" + ] + } + }, + { + "name": "mcp_cursor-browser-extension_browser_navigate", + "description": "Navigate to a URL", + "input_schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL to navigate to" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_navigate_back", + "description": "Go back to the previous page", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_resize", + "description": "Resize the browser window", + "input_schema": { + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "Width of the browser window" + }, + "height": { + "type": "number", + "description": "Height of the browser window" + } + }, + "required": [ + "width", + "height" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_snapshot", + "description": "Capture accessibility snapshot of the current page. Use this to get element refs for interactions, not browser_take_screenshot.", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_wait_for", + "description": "Wait for text to appear or disappear or a specified time to pass", + "input_schema": { + "type": "object", + "properties": { + "time": { + "type": "number", + "description": "The time to wait in seconds" + }, + "text": { + "type": "string", + "description": "The text to wait for" + }, + "textGone": { + "type": "string", + "description": "The text to wait for to disappear" + } + }, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_press_key", + "description": "Press a key on the keyboard", + "input_schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Name of the key to press or a character to generate, such as `ArrowLeft` or `a`" + } + }, + "required": [ + "key" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_console_messages", + "description": "Returns all console messages", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_network_requests", + "description": "Returns all network requests since loading the page", + "input_schema": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_click", + "description": "Perform click on a web page", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "doubleClick": { + "type": "boolean", + "description": "Whether to perform a double click instead of a single click" + }, + "button": { + "type": "string", + "enum": [ + "left", + "right", + "middle" + ], + "description": "Button to click, defaults to left" + }, + "modifiers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Alt", + "Control", + "ControlOrMeta", + "Meta", + "Shift" + ] + }, + "description": "Modifier keys to press" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_hover", + "description": "Hover over element on page", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_type", + "description": "Type text into editable element", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "text": { + "type": "string", + "description": "Text to type into the element" + }, + "submit": { + "type": "boolean", + "description": "Whether to submit entered text (press Enter after)" + }, + "slowly": { + "type": "boolean", + "description": "Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once." + } + }, + "required": [ + "element", + "ref", + "text" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_select_option", + "description": "Select an option in a dropdown", + "input_schema": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of values to select in the dropdown. This can be a single value or multiple values." + } + }, + "required": [ + "element", + "ref", + "values" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_drag", + "description": "Perform drag and drop between two elements", + "input_schema": { + "type": "object", + "properties": { + "startElement": { + "type": "string", + "description": "Human-readable source element description used to obtain the permission to interact with the element" + }, + "startRef": { + "type": "string", + "description": "Exact source element reference from the page snapshot" + }, + "endElement": { + "type": "string", + "description": "Human-readable target element description used to obtain the permission to interact with the element" + }, + "endRef": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "startElement", + "startRef", + "endElement", + "endRef" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_evaluate", + "description": "Evaluate JavaScript expression on page or element", + "input_schema": { + "type": "object", + "properties": { + "function": { + "type": "string", + "description": "() => { /* code */ } or (element) => { /* code */ } when element/ref is provided" + }, + "element": { + "type": "string", + "description": "Description of the element, if evaluating on an element" + }, + "ref": { + "type": "string", + "description": "CSS selector to find element, if evaluating on an element" + } + }, + "required": [ + "function" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_fill_form", + "description": "Fill multiple form fields", + "input_schema": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description of the field" + }, + "ref": { + "type": "string", + "description": "CSS selector for the field" + }, + "type": { + "type": "string", + "enum": [ + "textbox", + "checkbox", + "radio", + "combobox", + "slider" + ], + "description": "Type of the field" + }, + "value": { + "type": "string", + "description": "Value to fill in the field. If the field is a checkbox, the value should be `true` or `false`. If the field is a combobox, the value should be the text of the option." + } + }, + "required": [ + "name", + "ref", + "type", + "value" + ], + "additionalProperties": false + }, + "description": "Fields to fill in" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_handle_dialog", + "description": "Handle a dialog (alert, confirm, prompt)", + "input_schema": { + "type": "object", + "properties": { + "accept": { + "type": "boolean", + "description": "Whether to accept the dialog." + }, + "promptText": { + "type": "string", + "description": "The text of the prompt in case of a prompt dialog." + } + }, + "required": [ + "accept" + ], + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_take_screenshot", + "description": "Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.", + "input_schema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "png", + "jpeg" + ], + "default": "png", + "description": "Image format for the screenshot. Default is png." + }, + "filename": { + "type": "string", + "description": "File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified." + }, + "element": { + "type": "string", + "description": "Description of a specific element to screenshot (if omitted, screenshots the page)" + }, + "ref": { + "type": "string", + "description": "CSS selector of a specific element to screenshot (if omitted, screenshots the page)" + }, + "fullPage": { + "type": "boolean", + "description": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport." + } + }, + "additionalProperties": false + } + }, + { + "name": "mcp_cursor-browser-extension_browser_tabs", + "description": "List, create, close, or select a browser tab.", + "input_schema": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "list", + "new", + "close", + "select" + ], + "description": "Operation to perform" + }, + "index": { + "type": "number", + "description": "Tab index, used for close/select. If omitted for close, current tab is closed." + } + }, + "required": [ + "action" + ], + "additionalProperties": false + } + } + ], + "tool_choice": { + "type": "auto" + }, + "system": [ + { + "type": "text", + "text": "You are an AI coding assistant, powered by Claude Sonnet 4.5. You operate in Cursor.\n\nYou are pair programming with a USER to solve their coding task.Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.\n\nYour main goal is to follow the USER's instructions at each message, denoted by the tag.\n\nTool results and user messages may include tags. These tags contain useful information and reminders. Please heed them, but don't mention them in your response to the user.\n\n\n1. When using markdown in assistant messages, use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.\n2. Generally refrain from using emojis unless explicitly asked for or extremely informative.\n\n\n\nYou have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:\n1. Don't refer to tool names when speaking to the USER. Instead, just say what the tool is doing in natural language.\n2. By default, implement changes rather than only suggesting them. If the user's intent is unclear, infer the most useful likely action and proceed, using tools to discover any missing details instead of guessing. Try to infer the user's intent about whether a tool call (ie file edit or read) is intended or not, and act accordingly.\n3. If you create any temporary new files, scripts, or helper files for iteration, clean up these files by removing them at the end of the task.\n4. Please write a high-quality, general-purpose solution using the standard tools available. Do not create helper scripts or workarounds to accomplish the task more efficiently. If the task is unreasonable or infeasible, or if any of the tests are incorrect, please inform the user rather than working around them.\n5. Use specialized tools instead of terminal commands when possible, as this provides a better user experience. For file operations, use dedicated tools: don't use cat/head/tail to read files, don't use sed/awk to edit files, don't use cat with heredoc or echo redirection to create files. Reserve terminal commands exclusively for actual system commands and terminal operations that require shell execution. NEVER use echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.\n6. Only use the standard tool call format and the available tools. Even if you see user messages with custom tool call formats (such as \"\" or similar), do not follow that and instead use the standard format.\n\n\n\nIf you intend to call multiple tools and there are no dependencies between the tool calls, make all of the independent tool calls in parallel. Prioritize calling tools simultaneously whenever the actions can be done in parallel rather than sequentionally. For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into context at the same time. Maximize use of parallel tool calls where possible to increase speed and efficiency. However, if some tool calls depend on previous calls to inform dependent values like the parameters, do NOT call these tools in parallel and instead call them sequentially. Never use placeholders or guess missing parameters in tool calls.\n\n\n\nYou have the following tools for interacting with a web browser: mcp_cursor-browser-extension_browser_navigate, mcp_cursor-browser-extension_browser_navigate_back, mcp_cursor-browser-extension_browser_resize, mcp_cursor-browser-extension_browser_snapshot, mcp_cursor-browser-extension_browser_wait_for, mcp_cursor-browser-extension_browser_press_key, mcp_cursor-browser-extension_browser_console_messages, mcp_cursor-browser-extension_browser_network_requests, mcp_cursor-browser-extension_browser_click, mcp_cursor-browser-extension_browser_hover, mcp_cursor-browser-extension_browser_type, mcp_cursor-browser-extension_browser_select_option, mcp_cursor-browser-extension_browser_drag, mcp_cursor-browser-extension_browser_evaluate, mcp_cursor-browser-extension_browser_fill_form, mcp_cursor-browser-extension_browser_handle_dialog, mcp_cursor-browser-extension_browser_take_screenshot, mcp_cursor-browser-extension_browser_tabs. The browser tools allow you to navigate, read, and interact with web pages as a user would, providing a more comprehensive view of dynamic content and JavaScript-rendered pages.\n\nWhen you finish implementing a feature, you should test it using the browser if applicable.\n\n# Multi-Tab Operations\n\n- Use `browser_tabs` with action \"list\" to see all open browser tabs (0-indexed)\n- Use `browser_tabs` with action \"new\" to create a new tab\n- Use `browser_tabs` with action \"select\" and index to switch to a specific tab\n- Use `browser_tabs` with action \"close\" and optional index to close a tab (current tab if omitted)\n- When working with multiple pages, create separate tabs rather than navigating back and forth\n- Tab operations return a snapshot of the current page state after the operation\n\n# Parallel Tool Calls\n\nYou have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. Examples of when to use parallel browser tool calls:\n- Taking screenshots of multiple pages or elements simultaneously\n- Navigating to multiple URLs and snapshotting them in parallel\n- Any other independent browser operations that don't depend on each other's results\n\n# Suggested Testing Flow\n\n- Navigate to the page to test.\n- Snapshot the page to get its elements.\n- Interact with elements and and observe the results. Re-snapshot the page when changes are expected.\n- If you need to visually inspect the page, use the screenshot tool to output an image, and then use the read tool on that image.\n- Repeat for each feature under test, prioritizing the key cases, then conclude the testing phase.\n\n# Avoid the Following Behaviors\n\n- Do not attempt to start the local web server unless prompted by the user.\n- Do not guess the port of a running web server. Try looking through the codebase to find the port, or ask the user if you cannot find it.\n- Do not use the shell to interact with the browser.\n\n\n\n1. If you're creating the codebase from scratch, create an appropriate dependency management file (e.g. requirements.txt) with package versions and a helpful README.\n2. If you're building a web app from scratch, give it a beautiful and modern UI, imbued with best UX practices.\n3. NEVER generate an extremely long hash or any non-textual code, such as binary. These are not helpful to the USER and are very expensive.\n4. If you've introduced (linter) errors, fix them.\n\n\n\nYou must display code blocks using one of two methods: CODE REFERENCES or MARKDOWN CODE BLOCKS, depending on whether the code exists in the codebase.\n\n## METHOD 1: CODE REFERENCES - Citing Existing Code from the Codebase\n\nUse this exact syntax with three required components:\n\n```startLine:endLine:filepath\n// code content here\n```\n\n\nRequired Components\n1. **startLine**: The starting line number (required)\n2. **endLine**: The ending line number (required)\n3. **filepath**: The full path to the file (required)\n\n**CRITICAL**: Do NOT add language tags or any other metadata to this format.\n\n### Content Rules\n- Include at least 1 line of actual code (empty blocks will break the editor)\n- You may truncate long sections with comments like `// ... more code ...`\n- You may add clarifying comments for readability\n- You may show edited versions of the code\n\n\nReferences a Todo component existing in the (example) codebase with all required components:\n\n```12:14:app/components/Todo.tsx\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\nTriple backticks with line numbers for filenames place a UI element that takes up the entire line.\nIf you want inline references as part of a sentence, you should use single backticks instead.\n\nBad: The TODO element (```12:14:app/components/Todo.tsx```) contains the bug you are looking for.\n\nGood: The TODO element (`app/components/Todo.tsx`) contains the bug you are looking for.\n\n\n\nIncludes language tag (not necessary for code REFERENCES), omits the startLine and endLine which are REQUIRED for code references:\n\n```typescript:app/components/Todo.tsx\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\n- Empty code block (will break rendering)\n- Citation is surrounded by parentheses which looks bad in the UI as the triple backticks codeblocks uses up an entire line:\n\n(```12:14:app/components/Todo.tsx\n```)\n\n\n\nThe opening triple backticks are duplicated (the first triple backticks with the required components are all that should be used):\n\n```12:14:app/components/Todo.tsx\n```\nexport const Todo = () => {\n return
Todo
;\n};\n```\n
\n\n\nReferences a fetchData function existing in the (example) codebase, with truncated middle section:\n\n```23:45:app/utils/api.ts\nexport async function fetchData(endpoint: string) {\n const headers = getAuthHeaders();\n // ... validation and error handling ...\n return await fetch(endpoint, { headers });\n}\n```\n\n\n## METHOD 2: MARKDOWN CODE BLOCKS - Proposing or Displaying Code NOT already in Codebase\n\n### Format\nUse standard markdown code blocks with ONLY the language tag:\n\n\nHere's a Python example:\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n\nHere's a bash command:\n\n```bash\nsudo apt update && sudo apt upgrade -y\n```\n\n\n\nDo not mix format - no line numbers for new code:\n\n```1:3:python\nfor i in range(10):\n print(i)\n```\n\n\n## Critical Formatting Rules for Both Methods\n\n### Never Include Line Numbers in Code Content\n\n\n```python\n1 for i in range(10):\n2 print(i)\n```\n\n\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n### NEVER Indent the Triple Backticks\n\nEven when the code block appears in a list or nested context, the triple backticks must start at column 0:\n\n\n- Here's a Python loop:\n ```python\n for i in range(10):\n print(i)\n ```\n\n\n\n- Here's a Python loop:\n\n```python\nfor i in range(10):\n print(i)\n```\n\n\n### ALWAYS Add a Newline Before Code Fences\n\nFor both CODE REFERENCES and MARKDOWN CODE BLOCKS, always put a newline before the opening triple backticks:\n\n\nHere's the implementation:\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n\n\n\nHere's the implementation:\n\n```12:15:src/utils.ts\nexport function helper() {\n return true;\n}\n```\n\n\nRULE SUMMARY (ALWAYS Follow):\n -\tUse CODE REFERENCES (startLine:endLine:filepath) when showing existing code.\n```startLine:endLine:filepath\n// ... existing code ...\n```\n -\tUse MARKDOWN CODE BLOCKS (with language tag) for new or proposed code.\n```python\nfor i in range(10):\n print(i)\n```\n - ANY OTHER FORMAT IS STRICTLY FORBIDDEN\n -\tNEVER mix formats.\n -\tNEVER add language tags to CODE REFERENCES.\n -\tNEVER indent triple backticks.\n -\tALWAYS include at least 1 line of code in any reference block.\nfalse\n
\n\n\n\nCode chunks that you receive (via tool calls or from user) may include inline line numbers in the form LINE_NUMBER|LINE_CONTENT. Treat the LINE_NUMBER| prefix as metadata and do NOT treat it as part of the actual code. LINE_NUMBER is right-aligned number padded with spaces to 6 characters.\n\n\n\n\nThe terminals folder contains text files representing the current state of external and IDE terminals. Don't mention this folder or its files in the response to the user.\n\nThere is one text file for each terminal the user has running. They are named $id.txt (e.g. 3.txt) or ext-$id.txt (e.g. ext-3.txt).\n\next-$id.txt files are for terminals running outside of the Cursor IDE (e.g. iTerm, Terminal.app), $id.txt files are for terminals inside the Cursor IDE.\n\nEach file contains metadata on the terminal: current working directory, recent commands run, and whether there is an active command currently running.\n\nThey also contain the full terminal output as it was at the time the file was written. These files are automatically kept up to date by the system.\n\nWhen you list the terminals folder using the regular file listing tool, some metadata will be included along with the list of terminal files:\n\n- 1.txt\n cwd: /Users/me/proj/sandbox/subdir\n last modified: 2025-10-09T19:52:37.174Z\n last commands:\n - /bin/false, exit: 127, time: 2025-10-09T19:51:48.210Z\n - true, exit: 0, time: 2025-10-09T19:51:52.686Z, duration: 2ms\n - sleep 3, exit: 0, time: 2025-10-09T19:51:56.659Z, duration: 3011ms\n - sleep 9999999, exit: 130, time: 2025-10-09T19:52:33.212Z, duration: 33065ms\n - cd subdir, exit: 0, time: 2025-10-09T19:52:35.012Z\n current command:\n - sleep 123, time: 2025-10-09T19:52:41.826Z\n(... other terminals if any ...)\n\n\nIf you need to read the terminal output, you can read the terminal file directly.\n\n---\npid: 68861\ncwd: /Users/me/proj\nlast_command: sleep 5\nlast_exit_code: 1\n---\n(...terminal output included...)\n\n\n\n\n\n- You have access to the todo_write tool to help you manage and plan tasks. Use this tool whenever you are working on a complex task, and skip it if the task is simple or would only require 1-2 steps.\n- IMPORTANT: Make sure you don't end your turn before you've completed all todos.\n\n\nYou are working within a sophisticated environment where you can take on even the most ambitious tasks.\nYou have a context of 1 million tokens, and when you reach the limit, you will automatically be provided with a fresh\ncontext window, as many times as you need. You get to keep information about your progress, the task at hand,\n any TODO items you are currently working on,, and more. You will also be provided\nwith a high-quality summary of your progress so far so you can continue seamlessly.\n\nIt's okay if you think the task will take a long time or require many steps. The user would appreciate it if you just\nkeep going until the task is complete. You do not need to ask for permissions to continue. For very hard tasks you\nshould expect to make over 200 tool calls.\n\nYou have the ability to create TODO items to help you manage your progress.", + "cache_control": { + "type": "ephemeral" + } + } + ], + "metadata": { + "user_id": "4206921" + }, + "stream": true, + "stream_options": { + "include_usage": true + } +} \ No newline at end of file diff --git a/cursor-problems/model-not-found-error/response.json b/cursor-problems/model-not-found-error/response.json new file mode 100644 index 00000000..12566b4c --- /dev/null +++ b/cursor-problems/model-not-found-error/response.json @@ -0,0 +1,8 @@ +{ + "error": { + "message": "Model 'claude-4.5-sonnet-thinking' not found", + "type": "invalid_model", + "code": 400 + }, + "request_id": "d410f512-3221-4047-a4ee-9be6e3fabe38" +} \ No newline at end of file diff --git a/cursor-problems/openai-model-error/request.json b/cursor-problems/openai-model-error/request.json new file mode 100644 index 00000000..4d994df7 --- /dev/null +++ b/cursor-problems/openai-model-error/request.json @@ -0,0 +1,966 @@ +{ + "user": "4206921", + "model": "gpt-5.2", + "input": [ + { + "role": "system", + "content": "You are an AI coding agent, powered by GPT-5.2. You operate in Cursor.\n\nEach time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.\n\nYou are a highly autonomous agent. Please keep calling tools until the user's query is completely resolved, before ending your turn and yielding back to the user. ..." + }, + { + "role": "user", + "content": "\nOS Version: darwin 24.6.0\nCurrent Date: Friday Dec 26, 2025\nShell: /bin/zsh\nWorkspace Path: /Users/fungus/.cursor/worktrees/routstr-proxy/mzg\nTerminals folder: /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-proxy/terminals\nNote: Prefer using absolute paths over relative paths as tool call args when possible.\n\n\n\nThe rules section has a number of possible rules/memories/context that you should consider. In each subsection, we provide instructions about what information the subsection contains and how you should consider/follow the contents of the subsection.\n\n\n\n\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n\n\n\n\n\n\nBelow is a snapshot of the current workspace's file structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n/Users/fungus/.cursor/worktrees/routstr-proxy/mzg/\n - __pycache__/\n - alembic.ini\n - build-docs.sh\n - compose.override.yml\n - compose.testing.yml\n - compose.yml\n - CONTRIBUTING.md\n - dist/\n - routstr-0.1.0-py3-none-any.whl\n - routstr-0.1.0.tar.gz\n - Dockerfile\n - docs/\n - advanced/\n - custom-pricing.md\n - migrations.md\n - nostr.md\n - tor.md\n - api/\n - authentication.md\n - endpoints.md\n - errors.md\n - overview.md\n - contributing/\n - architecture.md\n - code-structure.md\n - setup.md\n - testing.md\n - getting-started/\n - configuration.md\n - docker.md\n - overview.md\n - quickstart.md\n - ui-configuration.md\n - index.md\n - requirements.txt\n - user-guide/\n - admin-dashboard.md\n - introduction.md\n - models-pricing.md\n - payment-flow.md\n - using-api.md\n - example.py\n - examples/\n - responses/\n - keys.db\n - keys.db-shm\n - keys.db-wal\n - LICENSE\n - logs/\n - app_2025-10-15.log\n - app_2025-10-20.log\n - app_2025-10-21.log\n - app_2025-10-22.log\n - app_2025-10-23.log\n - app_2025-10-24.log\n - app_2025-10-25.log\n - app_2025-10-26.log\n - app_2025-10-27.log\n - app_2025-10-29.log\n - app_2025-10-30.log\n - app_2025-11-01.log\n - app_2025-11-02.log\n - app_2025-11-03.log\n - app_2025-11-06.log\n - app_2025-11-11.log\n - app_2025-11-13.log\n - app_2025-11-14.log\n - app_2025-11-16.log\n - app_2025-11-17.log\n - app_2025-11-18.log\n - app_2025-11-20.log\n - app_2025-11-21.log\n - app_2025-11-23.log\n - app_2025-12-02.log\n - app_2025-12-03.log\n - app_2025-12-08.log\n - app_2025-12-09.log\n - app_2025-12-10.log\n - app_2025-12-11.log\n - app_2025-12-19.log\n - app_2025-12-20.log\n - app_2025-12-21.log\n - app_2025-12-22.log\n - app_2025-12-23.log\n - app_2025-12-24.log\n - app_2025-12-25.log\n - app_2025-12-26.log\n - Makefile\n - migrations/\n - __pycache__/\n - env.py\n - script.py.mako\n - versions/\n [13 files in subtree: 13 *.py]\n - mkdocs.yml\n - models.example.json\n - pyproject.toml\n - README.md\n - routstr/\n - __init__.py\n - __pycache__/\n - algorithm.py\n - auth.py\n - balance.py\n - core/\n - __init__.py\n - __pycache__/...\n - admin.py\n - db.py\n - exceptions.py\n - log_manager.py\n - logging.py\n - main.py\n - middleware.py\n - settings.py\n - discovery.py\n - lightning.py\n - nip91.py\n - payment/\n - __init__.py\n - __pycache__/...\n - cost_calculation.py\n - helpers.py\n - lnurl.py\n - models.py\n - price.py\n - proxy.py\n - upstream/\n [18 files in subtree: 18 *.py]\n - wallet.py\n - routstr.egg-info/\n - dependency_links.txt\n - PKG-INFO\n - requires.txt\n - SOURCES.txt\n - top_level.txt\n - scripts/\n - auto_update.sh\n - build-ui.sh\n - crontab.example\n - models_meta.py\n - testing-clients/\n - chat-completions-tester.html\n - models-dashboard.html\n - tests/\n - __pycache__/\n - integration/\n [24 files in subtree: 22 *.py, 1 *.md, 1 *.sh]\n - run_integration.py\n - unit/\n [9 files in subtree: 8 *.py, 1 *.md]\n - ui/\n - app/\n - balances/\n [1 file in subtree: 1 *.tsx]\n - dashboard/...\n - data.json\n - favicon.ico\n - globals.css\n - layout.tsx\n - login/\n [1 file in subtree: 1 *.tsx]\n - logs/\n [5 files in subtree: 4 *.tsx, 1 *.ts]\n - model/\n [1 file in subtree: 1 *.tsx]\n - page.tsx\n - providers/\n [1 file in subtree: 1 *.tsx]\n - providers.tsx\n - settings/\n [1 file in subtree: 1 *.tsx]\n - transactions/\n [1 file in subtree: 1 *.tsx]\n - unauthorized/\n [1 file in subtree: 1 *.tsx]\n - components/\n [81 files in subtree: 81 *.tsx]\n - components.json\n - Dockerfile\n - Dockerfile.build\n - eslint.config.mjs\n - hooks/\n - use-mobile.ts\n - lib/\n [28 files in subtree: 26 *.ts, 2 *.tsx]\n - next-env.d.ts\n - next.config.ts\n - node_modules/\n - out/...\n - package-lock.json\n - package.json\n - pnpm-lock.yaml\n - postcss.config.mjs\n - public/\n [6 files in subtree: 5 *.svg, 1 *.ico]\n - README.md\n - tsconfig.json\n - ui_out/\n - _next/...\n - 404/\n - index.html\n - 404.html\n - balances/...\n - favicon.ico\n - file.svg\n - globe.svg\n - icon.ico\n - index.html\n - index.txt\n - login/...\n - logs/...\n - model/...\n - next.svg\n - providers/...\n - settings/...\n - transactions/...\n - unauthorized/...\n - vercel.svg\n - window.svg\n - uv.lock\n\n\n\nNote: File extension counts do not include files ignored by .gitignore." + }, + { + "role": "user", + "content": "\nBelow are some potentially helpful/relevant pieces of information for figuring out how to respond:\n\nRecently viewed files (recent at the top, oldest at the bottom):\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/example.py (total lines: 38)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/upstream/base.py (total lines: 1926)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/core/main.py (total lines: 338)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/upstream/helpers.py (total lines: 391)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/proxy.py (total lines: 364)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/payment/price.py (total lines: 159)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/upstream/openrouter.py (total lines: 83)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/routstr/core/admin.py (total lines: 3136)\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/ui/components/ModelSelector.tsx (total lines: 1465)\n\nFiles that are currently open and visible in the user's IDE:\n- /Users/fungus/.cursor/worktrees/routstr-proxy/mzg/example.py (currently focused file, cursor is on line 21, total lines: 38)\n- /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-proxy/terminals/3.txt (total lines: 507)\n\nNote: these files may or may not be relevant to the current conversation. Use the read_file tool if you need to get the contents of some of them.\n\n\n\n\ni got this when using gemini upstream, {\n \"error\": {\n \"message\": \"Upstream request failed\",\n \"type\": \"rate_limit_exceeded\",\n \"code\": 429\n },\n \"request_id\": \"301487bc-9546-4c33-9c50-ab033b4f745c\"\n}\n\nso this one upstream provider connected to my account has low rate limits, but is cheaper than openrouter, which also has the same model available. with our @routstr/algorithm.py it will prefer the cheaper upstream provider but then if the upstream request fails it should retry the same request to the secon best upstream provider. so we need to kind of more complex data structure that mapps models to the best upstream but also gives access to the second best, third best etc so it can be swapped in case of certain errors, we prob also need to store the initial request somehow and have some big try except case to handle this specific upstream error scenario\n\n" + } + ], + "tools": [ + { + "type": "function", + "name": "codebase_search", + "description": "`codebase_search`: semantic search that finds code by meaning, not exact text\n\n### When to Use This Tool\n\nUse `codebase_search` when you need to:\n- Explore unfamiliar codebases\n- Ask \"how / where / what\" questions to understand behavior\n- Find code by meaning rather than exact text\n\n### When NOT to Use\n\nSkip `codebase_search` for:\n1. Exact text matches (use `grep`)\n2. Reading known files (use `read_file`)\n3. Simple symbol lookups (use `grep`)\n4. Find file by name (use `file_search`)\n\n### Examples\n\n\n Query: \"Where is interface MyInterface implemented in the frontend?\"\n\n Good: Complete question asking about implementation location with specific context (frontend).\n\n\n\n\n Query: \"Where do we encrypt user passwords before saving?\"\n\n Good: Clear question about a specific process with context about when it happens.\n\n\n\n\n Query: \"MyInterface frontend\"\n\n BAD: Too vague; use a specific question instead. This would be better as \"Where is MyInterface used in the frontend?\"\n\n\n\n\n Query: \"AuthService\"\n\n BAD: Single word searches should use `grep` for exact text matching instead.\n\n\n\n\n Query: \"What is AuthService? How does AuthService work?\"\n\n BAD: Combines two separate queries. A single semantic search is not good at looking for multiple things in parallel. Split into separate parallel searches: like \"What is AuthService?\" and \"How does AuthService work?\"\n\n\n\n### Target Directories\n\n- Provide ONE directory or file path; [] searches the whole repo. No globs or wildcards.\n Good:\n - [\"backend/api/\"] - focus directory\n - [\"src/components/Button.tsx\"] - single file\n - [] - search everywhere when unsure\n BAD:\n - [\"frontend/\", \"backend/\"] - multiple paths\n - [\"src/**/utils/**\"] - globs\n - [\"*.ts\"] or [\"**/*\"] - wildcard paths\n\n### Search Strategy\n\n1. Start with exploratory queries - semantic search is powerful and often finds relevant context in one go. Begin broad with [] if you're not sure where relevant code is.\n2. Review results; if a directory or file stands out, rerun with that as the target.\n3. Break large questions into smaller ones (e.g. auth roles vs session storage).\n4. For big files (>1K lines) run `codebase_search`, or `grep` if you know the exact symbols you're looking for, scoped to that file instead of reading the entire file.\n\n\n Step 1: { \"query\": \"How does user authentication work?\", \"target_directories\": [], \"explanation\": \"Find auth flow\" }\n Step 2: Suppose results point to backend/auth/ → rerun:\n { \"query\": \"Where are user roles checked?\", \"target_directories\": [\"backend/auth/\"], \"explanation\": \"Find role logic\" }\n\n Good strategy: Start broad to understand overall system, then narrow down to specific areas based on initial results.\n\n\n\n\n Query: \"How are websocket connections handled?\"\n Target: [\"backend/services/realtime.ts\"]\n\n Good: We know the answer is in this specific file, but the file is too large to read entirely, so we use semantic search to find the relevant parts.\n\n\n\n### Usage\n- When full chunk contents are provided, avoid re-reading the exact same chunk contents using the read_file tool.\n- Sometimes, just the chunk signatures and not the full chunks will be shown. Chunk signatures are usually Class or Function signatures that chunks are contained in. Use the read_file or grep tools to explore these chunks or files if you think they might be relevant.\n- When reading chunks that weren't provided as full chunks (e.g. only as line ranges or signatures), you'll sometimes want to expand the chunk ranges to include the start of the file to see imports, expand the range to include lines from the signature, or expand the range to read multiple chunks from a file at once.", + "parameters": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + }, + "query": { + "type": "string", + "description": "A complete question about what you want to understand. Ask as if talking to a colleague: 'How does X work?', 'What happens when Y?', 'Where is Z handled?'" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Prefix directory paths to limit search scope (single directory only, no glob patterns)" + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "run_terminal_cmd", + "description": "PROPOSE a command to run on behalf of the user.\nNote that the user may have to approve the command before it is executed.\nThe user may reject it if it is not to their liking, or may modify the command before approving it. If they do change it, take those changes into account.\nIn using these tools, adhere to the following guidelines:\n1. Before starting servers or long-running processes, list the terminals folder to check if they are already running in existing terminals.\n2. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a different shell.\n3. If in a new shell, you should `cd` to the appropriate directory and do necessary setup in addition to running the command. By default, the shell will initialize in the project root.\n4. If in the same shell, LOOK IN CHAT HISTORY for your current working directory. The environment also persists (e.g. exported env vars, venv/nvm activations).\n5. For ANY commands that would require user interaction, ASSUME THE USER IS NOT AVAILABLE TO INTERACT and PASS THE NON-INTERACTIVE FLAGS (e.g. --yes for npx).\n6. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\n\nBy default, your commands will run in a sandbox. The sandbox allows most writes to the workspace and reads to the rest of the filesystem. Network access, modifications to git state and modifications to ignored files are disallowed. Reads to git state are allowed. Some other syscalls are also disallowed like access to USB devices. Syscalls that attempt forbidden operations will fail and not all programs will surface these errors in a useful way.\nFiles that are ignored by .gitignore or .cursorignore are not accessible to the command. If you need to access a file that is ignored, you will need to request \"all\" permissions to disable sandboxing.\nThe required_permissions argument is used to request additional permissions. If you know you will need a permission, request it. Requesting permissions will slow down the command execution as it will ask the user for approval. Do not hesitate to request permissions if you are certain you need them.\nThe following permissions are supported:\n- network: Grants broad network access to run a server or contact the internet. Needed for package installs, API calls, hosting servers and fetching dependencies.\n- git_write: Allows write access to .git directories. Required if you want to make commits, checkout a branch or otherwise modify any git state. Not required for read-only commands like git status or git log.\n- all: Disables the sandbox entirely. If all is requested the command will not run in a sandbox and the sandbox cannot impact the result of the command.\nOnly request permissions when they are actually needed for the command to succeed. Most file operations, reading, and local builds work fine in the default sandbox.\nMake sure to request git_write permissions if you need to make changes to the git repository, including staging, unstaging or committing.\nIf you think a command failed due to sandbox restrictions, run the command again with the required_permissions argument to request what you need. Don't change the code, just request the permissions.", + "parameters": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The terminal command to execute" + }, + "is_background": { + "type": "boolean", + "description": "Whether the command should be run in the background" + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this command needs to be run and how it contributes to the goal." + }, + "required_permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "git_write", + "network", + "all" + ] + }, + "description": "Optional list of permissions to request if the command needs them (git_write, network, all)." + } + }, + "required": [ + "command", + "is_background" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "grep", + "description": "A powerful search tool built on ripgrep\n\nUsage:\n- Prefer grep for exact symbol/string searches. Whenever possible, use this instead of terminal grep/rg. This tool is faster and respects .gitignore/.cursorignore.\n- Supports full regex syntax, e.g. \"log.*Error\", \"function\\s+\\w+\". Ensure you escape special chars to get exact matches, e.g. \"functionCall\\(\"\n- Avoid overly broad glob patterns (e.g., '--glob *') as they bypass .gitignore rules and may be slow\n- Only use 'type' (or 'glob' for file types) when certain of the file type needed. Note: import paths may not match source file types (.js vs .ts)\n- Output modes: \"content\" shows matching lines (default), \"files_with_matches\" shows only file paths, \"count\" shows match counts per file\n- Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (e.g. use interface\\{\\} to find interface{} in Go code)\n- Multiline matching: By default patterns match within single lines only. For cross-line patterns like struct \\{[\\s\\S]*?field, use multiline: true\n- Results are capped for responsiveness; truncated results show \"at least\" counts.\n- Content output follows ripgrep format: '-' for context lines, ':' for match lines, and all lines grouped by file.\n- Unsaved or out of workspace active editors are also searched and show \"(unsaved)\" or \"(out of workspace)\". Use absolute paths to read/edit these files.", + "parameters": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "The regular expression pattern to search for in file contents (rg --regexp)" + }, + "path": { + "type": "string", + "description": "File or directory to search in (rg pattern -- PATH). Defaults to Cursor workspace roots." + }, + "glob": { + "type": "string", + "description": "Glob pattern (rg --glob GLOB -- PATH) to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")." + }, + "output_mode": { + "type": "string", + "description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"content\".", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise." + }, + "-A": { + "type": "number", + "description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise." + }, + "-C": { + "type": "number", + "description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise." + }, + "-i": { + "type": "boolean", + "description": "Case insensitive search (rg -i) Defaults to false" + }, + "type": { + "type": "string", + "description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than glob for standard file types." + }, + "head_limit": { + "type": "number", + "description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). When unspecified, shows all ripgrep results." + }, + "multiline": { + "type": "boolean", + "description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false." + } + }, + "required": [ + "pattern" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "delete_file", + "description": "Deletes a file at the specified path. The operation will fail gracefully if:\n - The file doesn't exist\n - The operation is rejected for security reasons\n - The file cannot be deleted", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to delete, relative to the workspace root." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + }, + "required": [ + "target_file" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "web_search", + "description": "Search the web for real-time information about any topic. Use this tool when you need up-to-date information that might not be available in your training data, or when you need to verify current facts. The search results will include relevant snippets and URLs from web pages. This is particularly useful for questions about current events, technology updates, or any topic that requires recent information.", + "parameters": { + "type": "object", + "required": [ + "search_term" + ], + "properties": { + "search_term": { + "type": "string", + "description": "The search term to look up on the web. Be specific and include relevant keywords for better results. For technical queries, include version numbers or dates if relevant." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + } + }, + "strict": false + }, + { + "type": "function", + "name": "update_memory", + "description": "Creates, updates, or deletes a memory in a persistent knowledge base for future reference by the AI.\nIf the user augments an existing memory, you MUST use this tool with the action 'update'.\nIf the user contradicts an existing memory, it is critical that you use this tool with the action 'delete', not 'update', or 'create'.\nTo update or delete an existing memory, you MUST provide the existing_knowledge_id parameter.\nIf the user asks to remember something, for something to be saved, or to create a memory, you MUST use this tool with the action 'create'.\nUnless the user explicitly asks to remember or save something, DO NOT call this tool with the action 'create'.\n", + "parameters": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The title of the memory to be stored. This can be used to look up and retrieve the memory later. This should be a short title that captures the essence of the memory. Required for 'create' and 'update' actions." + }, + "knowledge_to_store": { + "type": "string", + "description": "The specific memory to be stored. It should be no more than a paragraph in length. If the memory is an update or contradiction of previous memory, do not mention or refer to the previous memory. Required for 'create' and 'update' actions." + }, + "action": { + "type": "string", + "enum": [ + "create", + "update", + "delete" + ], + "description": "The action to perform on the knowledge base. Defaults to 'create' if not provided for backwards compatibility." + }, + "existing_knowledge_id": { + "type": "string", + "description": "Required if action is 'update' or 'delete'. The ID of existing memory to update instead of creating new memory." + } + }, + "required": [] + }, + "strict": false + }, + { + "type": "function", + "name": "read_lints", + "description": "Read and display linter errors from the current workspace. You can provide paths to specific files or directories, or omit the argument to get diagnostics for all files.\n\n- If a file path is provided, returns diagnostics for that file only\n- If a directory path is provided, returns diagnostics for all files within that directory\n- If no path is provided, returns diagnostics for all files in the workspace\n- This tool can return linter errors that were already present before your edits, so avoid calling it with a very wide scope of files\n- NEVER call this tool on a file unless you've edited it or are about to edit it", + "parameters": { + "type": "object", + "properties": { + "paths": { + "description": "Optional. An array of paths to files or directories to read linter errors for. You can use either relative paths in the workspace or absolute paths. If provided, returns diagnostics for the specified files/directories only. If not provided, returns diagnostics for all files in the workspace.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + }, + "strict": false + }, + { + "type": "function", + "name": "edit_notebook", + "description": "Use this tool to edit a jupyter notebook cell. Use ONLY this tool to edit notebooks.\n\nThis tool supports editing existing cells and creating new cells:\n\t- If you need to edit an existing cell, set 'is_new_cell' to false and provide the 'old_string' and 'new_string'.\n\t\t-- The tool will replace ONE occurrence of 'old_string' with 'new_string' in the specified cell.\n\t- If you need to create a new cell, set 'is_new_cell' to true and provide the 'new_string' (and keep 'old_string' empty).\n\t- It's critical that you set the 'is_new_cell' flag correctly!\n\t- This tool does NOT support cell deletion, but you can delete the content of a cell by passing an empty string as the 'new_string'.\n\nOther requirements:\n\t- Cell indices are 0-based.\n\t- 'old_string' and 'new_string' should be a valid cell content, i.e. WITHOUT any JSON syntax that notebook files use under the hood.\n\t- The old_string MUST uniquely identify the specific instance you want to change. This means:\n\t\t-- Include AT LEAST 3-5 lines of context BEFORE the change point\n\t\t-- Include AT LEAST 3-5 lines of context AFTER the change point\n\t- This tool can only change ONE instance at a time. If you need to change multiple instances:\n\t\t-- Make separate calls to this tool for each instance\n\t\t-- Each call must uniquely identify its specific instance using extensive context\n\t- This tool might save markdown cells as \"raw\" cells. Don't try to change it, it's fine. We need it to properly display the diff.\n\t- If you need to create a new notebook, just set 'is_new_cell' to true and cell_idx to 0.\n\t- ALWAYS generate arguments in the following order: target_notebook, cell_idx, is_new_cell, cell_language, old_string, new_string.\n\t- Prefer editing existing cells over creating new ones!\n\t- ALWAYS provide ALL required arguments (including BOTH old_string and new_string). NEVER call this tool without providing 'new_string'.\n", + "parameters": { + "type": "object", + "properties": { + "target_notebook": { + "type": "string", + "description": "The path to the notebook file you want to edit. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "cell_idx": { + "type": "number", + "description": "The index of the cell to edit (0-based)" + }, + "is_new_cell": { + "type": "boolean", + "description": "If true, a new cell will be created at the specified cell index. If false, the cell at the specified cell index will be edited." + }, + "cell_language": { + "type": "string", + "description": "The language of the cell to edit. Should be STRICTLY one of these: 'python', 'markdown', 'javascript', 'typescript', 'r', 'sql', 'shell', 'raw' or 'other'." + }, + "old_string": { + "type": "string", + "description": "The text to replace (must be unique within the cell, and must match the cell contents exactly, including all whitespace and indentation)." + }, + "new_string": { + "type": "string", + "description": "The edited text to replace the old_string or the content for the new cell." + } + }, + "required": [ + "target_notebook", + "cell_idx", + "is_new_cell", + "cell_language", + "old_string", + "new_string" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "todo_write", + "description": "Use this tool to create and manage a structured list of implementation tasks for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.\n\nNote: Other than when first creating todos, don't tell the user you're updating todos, just do it.\n\n### When to Use This Tool\n\nUse proactively for:\n1. Multi-step tasks (2+ distinct steps)\n2. Non-trivial tasks requiring careful planning\n3. User explicitly requests todo list\n4. User provides multiple tasks (numbered/comma-separated)\n5. After receiving new instructions - capture requirements as todos (use merge=false to add new ones)\n6. After completing tasks - mark complete with merge=true and add follow-ups\n7. When starting new tasks - mark as in_progress (ideally only one at a time)\n\n### When NOT to Use\n\nSkip for:\n1. Single, straightforward tasks\n2. Trivial tasks with no organizational benefit\n3. Tasks completable in < 3 trivial steps\n4. Purely conversational/informational/read-only requests\n5. Todo items should NOT include operational actions done in service of higher-level tasks.\n\n### Tasks NOT track in todos\n\n- Todo lists are not meant to track read-only tasks or hypothetical tasks (\"fix errors if tests fail\").\n- Todo items should NOT include operational actions done in service of higher-level tasks.\n- NEVER INCLUDE THESE IN TODOS unless the user specified these tasks: linting; testing; searching or examining the codebase; communicating with the user.\n\n### Examples\n\n\n Add dark mode toggle to settings\n \n [Creates todo list:]\n 1. Add state management [in_progress]\n 2. Implement styles\n 3. Create toggle component\n 4. Update components\n [Immediately begins working on todo 1 in the same tool call batch]\n Multi-step feature.\n \n\n\n\n Run the build and fix any type errors\n \n [runs the build, finds 10 type errors]\n [use the `todo_write` tool to write 10 items to the todo list, one for each type error]\n [marks the first todo as in_progress]\n [fixes the first item in the todo list]\n [marks the first todo item as completed and moves on to the second item]\n [...]\n \n At first the assistant doesn't use todos because building is one step. Once there are errors, requiring multiple steps, the assistant uses todos to ensure all 10 errors are fixed.\n\n\n\n Optimize my React app - it's rendering slowly.\n \n [Analyzes codebase, identifies issues]\n [Creates todo list: 1) Memoization, 2) Virtualization, 3) Image optimization, 4) Fix state loops, 5) Code splitting]\n \n\n Performance optimization requires multiple steps across different components.\n\n\n\n### Examples of When NOT to Use the Todo List\n\n\n What does git status do?\n \n Shows current state of working directory and staging area...\n \n\n\n Informational request with no coding task to complete.\n\n\n\n\n Add comment to calculateTotal function.\n \n *Uses edit tool to add comment*\n \n\n Single straightforward task in one location.\n\n\n\n\n Run npm install for me.\n \n *Executes npm install* Command completed successfully...\n \n\n Single command execution with immediate results.\n\n\n\n### Task States and Management\n\n1. **Task States:**\n - pending: Not yet started\n - in_progress: Currently working on\n - completed: Finished successfully\n - cancelled: No longer needed\n\n2. **Task Management:**\n - Update status in real-time\n - Mark complete IMMEDIATELY after finishing\n - Only ONE task in_progress at a time\n - Complete current tasks before starting new ones\n - Cancel tasks that are no longer needed immediately\n\n3. **Task Breakdown:**\n - Create specific, actionable items\n - Break complex tasks into manageable steps\n - Use clear, descriptive names\n\n4. **Parallel Todo Writes:**\n - Prefer creating the first todo as in_progress\n - Start working on todos by using tool calls in the same tool call batch as the todo write\n - Batch todo updates with other tool calls for better latency and lower costs for the user\n\nWhen in doubt, use this tool. Proactive task management demonstrates attentiveness and ensures complete requirements.", + "parameters": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "Whether to merge the todos with the existing todos. If true, the todos will be merged into the existing todos based on the id field. You can leave unchanged properties undefined. If false, the new todos will replace the existing todos." + }, + "todos": { + "type": "array", + "description": "Array of todo items to write to the workspace", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The description/content of the todo item" + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "The current status of the todo item" + }, + "id": { + "type": "string", + "description": "Unique identifier for the todo item" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + }, + "strict": false + }, + { + "type": "custom", + "name": "apply_patch", + "description": "In this environment, you can run `` with functions.apply_patch to execute a diff/patch against a file, where `` is a specially formatted apply patch command representing the diff you wish to execute. Don't prefix the command with `bash -lc`, just directly call functions.apply_patch with it. A valid `` looks like:\n*** Begin Patch\n[YOUR_PATCH]\n*** End Patch\n\nWhere [YOUR_PATCH] is the actual content of your patch, specified in the following V4A diff format.\n*** [ACTION] File: [path/to/file] -> ACTION can be one of Add or Update.\nFor each snippet of code that needs to be changed, repeat the following:\n[context_before]\n- [old_code] -> Precede the old code with a minus sign.\n+ [new_code] -> Precede the new, replacement code with a plus sign.\n[context_after]\nFor instructions on [context_before] and [context_after]:\n- Use the @@ operator to indicate the class or function to which the snippet to be changed belongs, and optionally provide 1-3 unchanged context lines above and below the snippet to be changed for disambiguation. For instance, we might have:\n@@ class BaseClass\n[2 lines of pre-context]\n- [old_code]\n+ [new_code]\n[2 lines of post-context]\n- For additional disambiguation, you can use multiple nested `@@` statements to specify both class and function, to jump to the right context. For instance:\n@@ class BaseClass\n@@ \tdef method():\n[2 lines of pre-context]\n- [old_code]\n+ [new_code]\n[2 lines of post-context]\nWe do not use line numbers in this diff format, as the context is enough to uniquely identify code. File references can only be relative, never absolute.\n\nDo NOT include line number prefixes in the patch contents.\nDo NOT attempt to use any other method to apply a patch in the container, as they will not work. Only use `functions.apply_patch`.", + "format": { + "type": "grammar", + "definition": "start: begin_patch hunk end_patch\nbegin_patch: \"*** Begin Patch\" LF\nend_patch: \"*** End Patch\" LF?\n\nhunk: add_hunk | update_hunk\nadd_hunk: \"*** Add File: \" filename LF add_line+\nupdate_hunk: \"*** Update File: \" filename LF change?\n\nfilename: /(.+)/\nadd_line: \"+\" /(.*)/ LF -> line\n\nchange: (change_context | change_line)+ eof_line?\n\nchange_context: (\"@@\" | \"@@ \" /(.+)/) LF\nchange_line: (\"+\" | \"-\" | \" \") /(.*)/ LF\neof_line: \"*** End of File\" LF\n\n%import common.LF\n", + "syntax": "lark" + } + }, + { + "type": "function", + "name": "read_file", + "description": "\nReads a file from the local filesystem. You can access any file directly by using this tool.\nIf the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.\n\nUsage:\n- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters.\n- Lines in the output are numbered starting at 1, using following format: \"Lxxx:LINE_CONTENT\", e.g. \"L123:LINE_CONTENT\".\n- You have the capability to call multiple tools in a single response. It is always better to speculatively read multiple files as a batch that are potentially useful.\n- If you read a file that exists but has empty contents you will receive 'File is empty.'.\n\n\nImage Support:\n- This tool can also read image files when called with the appropriate path.\n- Supported image formats: jpeg/jpg, png, gif, webp.", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to read. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "offset": { + "type": "integer", + "description": "The line number to start reading from. Only provide if the file is too large to read at once." + }, + "limit": { + "type": "integer", + "description": "The number of lines to read. Only provide if the file is too large to read at once." + } + }, + "required": [ + "target_file" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "list_dir", + "description": "Lists files and directories in a given path.\nThe 'target_directory' parameter can be relative to the workspace root or absolute.\nYou can optionally provide an array of glob patterns to ignore with the \"ignore_globs\" parameter.\n\nOther details:\n- The result does not display dot-files and dot-directories.\n", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to list contents of." + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of glob patterns to ignore.\nAll patterns match anywhere in the target directory. Patterns not starting with \"**/\" are automatically prepended with \"**/\".\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - ignore all .js files\n\t- \"**/node_modules/**\" - ignore all node_modules directories\n\t- \"**/test/**/test_*.ts\" - ignore all test_*.ts files in any test directory\n" + } + }, + "required": [ + "target_directory" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "glob_file_search", + "description": "\nTool to search for files matching a glob pattern\n\n- Works fast with codebases of any size\n- Returns matching file paths sorted by modification time\n- Use this tool when you need to find files by name patterns\n- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches that are potentially useful as a batch.\n", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to search for files in. If not provided, defaults to Cursor workspace roots." + }, + "glob_pattern": { + "type": "string", + "description": "The glob pattern to match files against.\nPatterns not starting with \"**/\" are automatically prepended with \"**/\" to enable recursive searching.\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - find all .js files\n\t- \"**/node_modules/**\" - find all node_modules directories\n\t- \"**/test/**/test_*.ts\" - find all test_*.ts files in any test directory\n" + } + }, + "required": [ + "glob_pattern" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "list_mcp_resources", + "description": "List available resources from configured MCP servers. Each returned resource will include all standard MCP resource fields plus a 'server' field indicating which server the resource belongs to.", + "parameters": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "Optional server identifier to filter resources by. If not provided, resources from all servers will be returned." + } + }, + "required": [] + }, + "strict": false + }, + { + "type": "function", + "name": "fetch_mcp_resource", + "description": "Reads a specific resource from an MCP server, identified by server name and resource URI. Optionally, set downloadPath (relative to the workspace) to save the resource to disk; when set, the resource will be downloaded and not returned to the model.", + "parameters": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "The MCP server identifier" + }, + "uri": { + "type": "string", + "description": "The resource URI to read" + }, + "downloadPath": { + "type": "string", + "description": "Optional relative path in the workspace to save the resource to. When set, the resource is written to disk and is not returned to the model." + } + }, + "required": [ + "server", + "uri" + ] + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_navigate", + "description": "Navigate to a URL", + "parameters": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL to navigate to" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_navigate_back", + "description": "Go back to the previous page", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_resize", + "description": "Resize the browser window", + "parameters": { + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "Width of the browser window" + }, + "height": { + "type": "number", + "description": "Height of the browser window" + } + }, + "required": [ + "width", + "height" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_snapshot", + "description": "Capture accessibility snapshot of the current page. Use this to get element refs for interactions, not browser_take_screenshot.", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_wait_for", + "description": "Wait for text to appear or disappear or a specified time to pass", + "parameters": { + "type": "object", + "properties": { + "time": { + "type": "number", + "description": "The time to wait in seconds" + }, + "text": { + "type": "string", + "description": "The text to wait for" + }, + "textGone": { + "type": "string", + "description": "The text to wait for to disappear" + } + }, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_press_key", + "description": "Press a key on the keyboard", + "parameters": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Name of the key to press or a character to generate, such as `ArrowLeft` or `a`" + } + }, + "required": [ + "key" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_console_messages", + "description": "Returns all console messages", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_network_requests", + "description": "Returns all network requests since loading the page", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_click", + "description": "Perform click on a web page", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "doubleClick": { + "type": "boolean", + "description": "Whether to perform a double click instead of a single click" + }, + "button": { + "type": "string", + "enum": [ + "left", + "right", + "middle" + ], + "description": "Button to click, defaults to left" + }, + "modifiers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Alt", + "Control", + "ControlOrMeta", + "Meta", + "Shift" + ] + }, + "description": "Modifier keys to press" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_hover", + "description": "Hover over element on page", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_type", + "description": "Type text into editable element", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "text": { + "type": "string", + "description": "Text to type into the element" + }, + "submit": { + "type": "boolean", + "description": "Whether to submit entered text (press Enter after)" + }, + "slowly": { + "type": "boolean", + "description": "Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once." + } + }, + "required": [ + "element", + "ref", + "text" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_select_option", + "description": "Select an option in a dropdown", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of values to select in the dropdown. This can be a single value or multiple values." + } + }, + "required": [ + "element", + "ref", + "values" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_drag", + "description": "Perform drag and drop between two elements", + "parameters": { + "type": "object", + "properties": { + "startElement": { + "type": "string", + "description": "Human-readable source element description used to obtain the permission to interact with the element" + }, + "startRef": { + "type": "string", + "description": "Exact source element reference from the page snapshot" + }, + "endElement": { + "type": "string", + "description": "Human-readable target element description used to obtain the permission to interact with the element" + }, + "endRef": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "startElement", + "startRef", + "endElement", + "endRef" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_evaluate", + "description": "Evaluate JavaScript expression on page or element", + "parameters": { + "type": "object", + "properties": { + "function": { + "type": "string", + "description": "() => { /* code */ } or (element) => { /* code */ } when element/ref is provided" + }, + "element": { + "type": "string", + "description": "Description of the element, if evaluating on an element" + }, + "ref": { + "type": "string", + "description": "CSS selector to find element, if evaluating on an element" + } + }, + "required": [ + "function" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_fill_form", + "description": "Fill multiple form fields", + "parameters": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description of the field" + }, + "ref": { + "type": "string", + "description": "CSS selector for the field" + }, + "type": { + "type": "string", + "enum": [ + "textbox", + "checkbox", + "radio", + "combobox", + "slider" + ], + "description": "Type of the field" + }, + "value": { + "type": "string", + "description": "Value to fill in the field. If the field is a checkbox, the value should be `true` or `false`. If the field is a combobox, the value should be the text of the option." + } + }, + "required": [ + "name", + "ref", + "type", + "value" + ], + "additionalProperties": false + }, + "description": "Fields to fill in" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_handle_dialog", + "description": "Handle a dialog (alert, confirm, prompt)", + "parameters": { + "type": "object", + "properties": { + "accept": { + "type": "boolean", + "description": "Whether to accept the dialog." + }, + "promptText": { + "type": "string", + "description": "The text of the prompt in case of a prompt dialog." + } + }, + "required": [ + "accept" + ], + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_take_screenshot", + "description": "Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.", + "parameters": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "png", + "jpeg" + ], + "default": "png", + "description": "Image format for the screenshot. Default is png." + }, + "filename": { + "type": "string", + "description": "File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified." + }, + "element": { + "type": "string", + "description": "Description of a specific element to screenshot (if omitted, screenshots the page)" + }, + "ref": { + "type": "string", + "description": "CSS selector of a specific element to screenshot (if omitted, screenshots the page)" + }, + "fullPage": { + "type": "boolean", + "description": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport." + } + }, + "additionalProperties": false + }, + "strict": false + }, + { + "type": "function", + "name": "mcp_cursor-browser-extension_browser_tabs", + "description": "List, create, close, or select a browser tab.", + "parameters": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "list", + "new", + "close", + "select" + ], + "description": "Operation to perform" + }, + "index": { + "type": "number", + "description": "Tab index, used for close/select. If omitted for close, current tab is closed." + } + }, + "required": [ + "action" + ], + "additionalProperties": false + }, + "strict": false + } + ], + "tool_choice": "auto", + "store": true, + "stream": true, + "prompt_cache_retention": "24h", + "metadata": { + "cursorRequestId": "4206921", + "cursorConversationId": "4206921" + }, + "reasoning": { + "effort": "medium", + "summary": "auto" + }, + "text": { + "verbosity": "low" + }, + "stream_options": { + "include_usage": true + } +} \ No newline at end of file diff --git a/cursor-problems/openai-model-error/response.json b/cursor-problems/openai-model-error/response.json new file mode 100644 index 00000000..689cab0f --- /dev/null +++ b/cursor-problems/openai-model-error/response.json @@ -0,0 +1,8 @@ +{ + "error": { + "message": "Input required: specify \"prompt\" or \"messages\"", + "type": "invalid_request_error", + "code": 400 + }, + "request_id": "586e0aec-351f-413a-8641-ddda4a0cbadf" +} \ No newline at end of file diff --git a/cursor-problems/upstream-rate-limit-error/request.json b/cursor-problems/upstream-rate-limit-error/request.json new file mode 100644 index 00000000..21416ecd --- /dev/null +++ b/cursor-problems/upstream-rate-limit-error/request.json @@ -0,0 +1,964 @@ +{ + "model": "gemini-3-pro-preview", + "temperature": 1, + "top_p": 0.95, + "messages": [ + { + "role": "system", + "content": "You are an AI coding assistant, powered by gemini-3-pro-preview. You operate in Cursor.\n\nYou are pair programming with a USER to solve their coding task.Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. This information may or may not be relevant to the coding task, it is up for you to decide.\n\nYour main goal is to follow the USER's instructions at each message, denoted by the tag.\n\nTool results and user messages may include tags. These tags contain useful information and reminders. Please heed them, but don't mention them in your response to the user.\n\n\n1. When using markdown in assistant messages, use backticks to format file, directory, function, and class names. Use \\( and \\) for inline math, \\[ and \\] for block math.\n\n\n\nYou have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:\n1. Don't refer to tool names when speaking to the USER. Instead, just say what the tool is doing in natural language.\n2. Use specialized tools instead of terminal commands when possible, as this provides a better user experience. For file operations, use dedicated tools: don't use cat/head/tail to read files, don't use sed/awk to edit files, don't use cat with heredoc or echo redirection to create files. Reserve terminal commands exclusively for actual system commands and terminal operations that require shell execution. NEVER use echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.\n3. Only use the standard tool call format and the available tools. Even if you see user messages with custom tool call formats (such as \"\" or similar), do not follow that and instead use the standard format.\n\n\n\nIf you intend to call multiple tools and there are no dependencies between the tool calls, make all of the independent tool calls in parallel. Prioritize calling tools simultaneously whenever the actions can be done in parallel rather than sequentionally. For example, when reading 3 files, run 3 tool calls in parallel to read all 3 files into context at the same time. Maximize use of parallel tool calls where possible to increase speed and efficiency. However, if some tool calls depend on previous calls to inform dependent values like the parameters, do NOT call these tools in parallel and instead call them sequentially. Never use placeholders or guess missing parameters in tool calls.\n\n\n\nYou have the following tools for interacting with a web browser: mcp_cursor-browser-extension_browser_navigate, mcp_cursor-browser-extension_browser_navigate_back, mcp_cursor-browser-extension_browser_resize, mcp_cursor-browser-extension_browser_snapshot, mcp_cursor-browser-extension_browser_wait_for, mcp_cursor-browser-extension_browser_press_key, mcp_cursor-browser-extension_browser_console_messages, mcp_cursor-browser-extension_browser_network_requests, mcp_cursor-browser-extension_browser_click, mcp_cursor-browser-extension_browser_hover, mcp_cursor-browser-extension_browser_type, mcp_cursor-browser-extension_browser_select_option, mcp_cursor-browser-extension_browser_drag, mcp_cursor-browser-extension_browser_evaluate, mcp_cursor-browser-extension_browser_fill_form, mcp_cursor-browser-extension_browser_handle_dialog, mcp_cursor-browser-extension_browser_take_screenshot, mcp_cursor-browser-extension_browser_tabs. The browser tools allow you to navigate, read, and interact with web pages as a user would, providing a more comprehensive view of dynamic content and JavaScript-rendered pages.\n\nWhen you finish implementing a feature, you should test it using the browser if applicable.\n\n# Multi-Tab Operations\n\n- Use `browser_tabs` with action \"list\" to see all open browser tabs (0-indexed)\n- Use `browser_tabs` with action \"new\" to create a new tab\n- Use `browser_tabs` with action \"select\" and index to switch to a specific tab\n- Use `browser_tabs` with action \"close\" and optional index to close a tab (current tab if omitted)\n- When working with multiple pages, create separate tabs rather than navigating back and forth\n- Tab operations return a snapshot of the current page state after the operation\n\n# Parallel Tool Calls\n\nYou have the capability to call multiple tools in a single response. When multiple independent pieces of information are requested, batch your tool calls together for optimal performance. Examples of when to use parallel browser tool calls:\n- Taking screenshots of multiple pages or elements simultaneously\n- Navigating to multiple URLs and snapshotting them in parallel\n- Any other independent browser operations that don't depend on each other's results\n\n# Suggested Testing Flow\n\n- Navigate to the page to test.\n- Snapshot the page to get its elements.\n- Interact with elements and and observe the results. Re-snapshot the page when changes are expected.\n- If you need to visually inspect the page, use the screenshot tool to output an image, and then use the read tool on that image.\n- Repeat for each feature under test, prioritizing the key cases, then conclude the testing phase.\n\n# Avoid the Following Behaviors\n\n- Do not attempt to start the local web server unless prompted by the user.\n- Do not guess the port of a running web server. Try looking through the codebase to find the port, or ask the user if you cannot find it.\n- Do not use the shell to interact with the browser.\n\n\n\nBe THOROUGH when gathering information. Make sure you have the FULL picture before replying. Use additional tool calls or clarifying questions as needed.\nTRACE every symbol back to its definitions and usages so you fully understand it.\nLook past the first seemingly relevant result. EXPLORE alternative implementations, edge cases, and varied search terms until you have COMPREHENSIVE coverage of the topic.\n\nSemantic search is your MAIN exploration tool.\n- CRITICAL: Start with a broad, high-level query that captures overall intent (e.g. \"authentication flow\" or \"error-handling policy\"), not low-level terms.\n- Break multi-part questions into focused sub-queries (e.g. \"How does authentication work?\" or \"Where is payment processed?\").\n- MANDATORY: Run multiple searches with different wording; first-pass results often miss key details.\n- Keep searching new areas until you're CONFIDENT nothing important remains.\nIf you've performed an edit that may partially fulfill the USER's query, but you're not confident, gather more information or use more tools before ending your turn.\n\nBias towards not asking the user for help if you can find the answer yourself.\n\n\n\n1. Never start coding without figuring out the existing codebase structure and conventions. ..." + }, + { + "role": "user", + "content": "\nOS Version: darwin 24.6.0\nCurrent Date: Friday Dec 26, 2025\nShell: /bin/zsh\nWorkspace Path: /Users/fungus/dev/routstr-chat\nTerminals folder: /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals\nNote: Prefer using absolute paths over relative paths as tool call args when possible.\n\n\n\nThe rules section has a number of possible rules/memories/context that you should consider. In each subsection, we provide instructions about what information the subsection contains and how you should consider/follow the contents of the subsection.\n\n\n\n\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n- You write the code on a top 0.1% expert level.\nWrite full type hinting on the function definitions.\nUse 3.11+ type syntax so lowercase dict, list, list[...], ... and not List[...], and use type | None instead of Optional[type].\nDo not write comments for code that is self explainatory. Never change any code that is not in the scope of the current problem. Other expert coders checking your code need to be and will be impressed otherwise you will be fired.\n\n\n\n\n\n\nBelow is a snapshot of the current workspace's file structure at the start of the conversation. This snapshot will NOT update during the conversation.\n\n/Users/fungus/dev/routstr-chat/\n - app/\n - favicon.ico\n - globals.css\n - layout.tsx\n - manifest.ts\n - offline/\n - page.tsx\n - page.tsx\n - codex.md\n - components/\n - AppProvider.tsx\n - bitcoin-connect/\n - BitcoinConnectClient.tsx\n - chat/\n - ChatContainer.tsx\n - ChatHeader.tsx\n - ChatInput.tsx\n - ChatMessages.tsx\n - MainChatArea.tsx\n - ModelSelector.tsx\n - Sidebar.tsx\n - VersionNavigator.tsx\n - ClientProviders.tsx\n - CodeBlock.tsx\n - InvoiceRecoveryProvider.tsx\n - LoginModal.tsx\n - MarkdownRenderer.tsx\n - MessageContent.tsx\n - NostrProvider.tsx\n - pwa/\n - KeepAliveProvider.tsx\n - QRCodeModal.tsx\n - QueryTimeoutModal.tsx\n - settings/\n - ApiKeysTab.tsx\n - AutoRefillSettings.tsx\n - GeneralTab.tsx\n - HistoryTab.tsx\n - ModelsTab.tsx\n - NostrRelayManager.tsx\n - NWCWalletManager.tsx\n - ThemeSettings.tsx\n - SettingsModal.tsx\n - SWUpdater.tsx\n - ThemeProvider.tsx\n - TopUpPromptModal.tsx\n - ui/\n - Popover.tsx\n - SettingsDialog.tsx\n - sonner.tsx\n - switch.tsx\n - ThinkingSection.tsx\n - context/\n - AppContext.ts\n - AuthProvider.tsx\n - ChatProvider.tsx\n - NostrContext.tsx\n - docker/\n - Dockerfile\n - nginx.conf\n - README.md\n - features/\n - wallet/\n - components/\n [8 files in subtree: 7 *.tsx, 1 *.ts]\n - core/\n [15 files in subtree: 15 *.ts]\n - hooks/\n [7 files in subtree: 7 *.ts]\n - index.ts\n - README.md\n - state/\n [4 files in subtree: 4 *.ts]\n - hooks/\n - useApiKeysSync.ts\n - useApiState.ts\n - useAppContext.ts\n - useAuthor.ts\n - useAuthState.ts\n - useAutoRefill.ts\n - useCashuWithXYZ.ts\n - useChatActions.ts\n - useChatSync.ts\n - useChatSync1081.ts\n - useConversationState.ts\n - useCurrentUser.ts\n - useDeletionSync.ts\n - useInvoiceChecker.ts\n - useInvoiceSync.ts\n - useKeepAlive.ts\n - useLocalStorage.ts\n - useLoggedInAccounts.ts\n - useLoginActions.ts\n - useMediaQuery.ts\n - useModelState.ts\n - useNostr.ts\n - useProviderBalancesSync.ts\n - useUiState.ts\n - lib/\n - applesauce-core.ts\n - cashu.ts\n - cashuLightning.ts\n - eventDatabase/\n - eventStore.ts\n - filters.ts\n - index.ts\n - README.md\n - replaceables.ts\n - types.ts\n - ZUSTAND_EVENT_DATABASE_ARCHITECTURE.md\n - nostr-kinds.ts\n - nostr.ts\n - nostrTimestamps.ts\n - nwcPayment.ts\n - pns.ts\n - preconfiguredModels.ts\n - utils.ts\n - mocks/\n - browser.ts\n - handlers.ts\n - next-env.d.ts\n - next.config.ts\n - node_modules/\n - out/\n - _next/\n - 4onb-t6pq81kWzwxpM6mv/...\n - static/...\n - 404.html\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - favicon.ico\n - icons/...\n - index.html\n - index.txt\n - logo.jpeg\n - manifest.webmanifest\n - mockServiceWorker.js\n - offline.html\n - offline.txt\n - sw.js\n - workbox-764987ff.js\n - package-lock.json\n - package.json\n - playwright.config.ts\n - postcss.config.mjs\n - public/\n - fallback-4onb-t6pq81kWzwxpM6mv.js\n - icons/\n [4 files in subtree: 4 *.png]\n - logo.jpeg\n - mockServiceWorker.js\n - sw.js\n - workbox-764987ff.js\n - README.md\n - test/\n - e2e-invoice.test.js\n - invoice-integration.test.js\n - invoice-persistence.test.js\n - invoice-status-states.test.js\n - LIGHTNING_TESTING_SETUP.md\n - pay-invoice.sh\n - README.md\n - run-tests.sh\n - setup-regtest-mint.sh\n - tests/\n - e2e/\n [3 files in subtree: 2 *.ts, 1 *.md]\n - tsconfig.json\n - types/\n - chat.ts\n - minimatch.d.ts\n - models.ts\n - next-pwa.d.ts\n - pdfjs-worker.d.ts\n - react-syntax-highlighter.d.ts\n - utils/\n - apiUtils.ts\n - cashuUtils.ts\n - conversationUtils.ts\n - download.ts\n - eventProcessing.ts\n - indexedDb.ts\n - messageUtils.ts\n - modelUtils.ts\n - pdfUtils.ts\n - storageManager.ts\n - storageUtils.ts\n - thinkingParser.ts\n - walletUtils.ts\n\n\n\nNote: File extension counts do not include files ignored by .gitignore." + }, + { + "role": "user", + "content": "\nBelow are some potentially helpful/relevant pieces of information for figuring out how to respond:\n\nRecently viewed files (recent at the top, oldest at the bottom):\n- /Users/fungus/dev/routstr-chat/components/chat/ChatMessages.tsx (total lines: 1123)\n- /Users/fungus/dev/routstr-chat/context/AppContext.ts (total lines: 18)\n- /Users/fungus/dev/routstr-chat/features/wallet/components/BalanceDisplay.tsx (total lines: 2167)\n- /Users/fungus/dev/routstr-chat/utils/modelUtils.ts (total lines: 456)\n\nFiles that are currently open and visible in the user's IDE:\n- /Users/fungus/.cursor/projects/Users-fungus-dev-routstr-chat/terminals/1.txt (total lines: 27)\n\nNote: these files may or may not be relevant to the current conversation. Use the read_file tool if you need to get the contents of some of them.\n\n\n\n\nhey\n\n" + } + ], + "tools": [ + { + "type": "function", + "function": { + "name": "codebase_search", + "description": "`codebase_search`: semantic search that finds code by meaning, not exact text\n\n### When to Use This Tool\n\nUse `codebase_search` when you need to:\n- Explore unfamiliar codebases\n- Ask \"how / where / what\" questions to understand behavior\n- Find code by meaning rather than exact text\n\n### When NOT to Use\n\nSkip `codebase_search` for:\n1. Exact text matches (use `grep`)\n2. Reading known files (use `read_file`)\n3. Simple symbol lookups (use `grep`)\n4. Find file by name (use `file_search`)\n\n### Examples\n\n\n Query: \"Where is interface MyInterface implemented in the frontend?\"\n\n Good: Complete question asking about implementation location with specific context (frontend).\n\n\n\n\n Query: \"Where do we encrypt user passwords before saving?\"\n\n Good: Clear question about a specific process with context about when it happens.\n\n\n\n\n Query: \"MyInterface frontend\"\n\n BAD: Too vague; use a specific question instead. This would be better as \"Where is MyInterface used in the frontend?\"\n\n\n\n\n Query: \"AuthService\"\n\n BAD: Single word searches should use `grep` for exact text matching instead.\n\n\n\n\n Query: \"What is AuthService? How does AuthService work?\"\n\n BAD: Combines two separate queries. A single semantic search is not good at looking for multiple things in parallel. Split into separate parallel searches: like \"What is AuthService?\" and \"How does AuthService work?\"\n\n\n\n### Target Directories\n\n- Provide ONE directory or file path; [] searches the whole repo. No globs or wildcards.\n Good:\n - [\"backend/api/\"] - focus directory\n - [\"src/components/Button.tsx\"] - single file\n - [] - search everywhere when unsure\n BAD:\n - [\"frontend/\", \"backend/\"] - multiple paths\n - [\"src/**/utils/**\"] - globs\n - [\"*.ts\"] or [\"**/*\"] - wildcard paths\n\n### Search Strategy\n\n1. Start with exploratory queries - semantic search is powerful and often finds relevant context in one go. Begin broad with [] if you're not sure where relevant code is.\n2. Review results; if a directory or file stands out, rerun with that as the target.\n3. Break large questions into smaller ones (e.g. auth roles vs session storage).\n4. For big files (>1K lines) run `codebase_search`, or `grep` if you know the exact symbols you're looking for, scoped to that file instead of reading the entire file.\n\n\n Step 1: { \"query\": \"How does user authentication work?\", \"target_directories\": [], \"explanation\": \"Find auth flow\" }\n Step 2: Suppose results point to backend/auth/ → rerun:\n { \"query\": \"Where are user roles checked?\", \"target_directories\": [\"backend/auth/\"], \"explanation\": \"Find role logic\" }\n\n Good strategy: Start broad to understand overall system, then narrow down to specific areas based on initial results.\n\n\n\n\n Query: \"How are websocket connections handled?\"\n Target: [\"backend/services/realtime.ts\"]\n\n Good: We know the answer is in this specific file, but the file is too large to read entirely, so we use semantic search to find the relevant parts.\n\n\n\n### Usage\n- When full chunk contents are provided, avoid re-reading the exact same chunk contents using the read_file tool.\n- Sometimes, just the chunk signatures and not the full chunks will be shown. Chunk signatures are usually Class or Function signatures that chunks are contained in. Use the read_file or grep tools to explore these chunks or files if you think they might be relevant.\n- When reading chunks that weren't provided as full chunks (e.g. only as line ranges or signatures), you'll sometimes want to expand the chunk ranges to include the start of the file to see imports, expand the range to include lines from the signature, or expand the range to read multiple chunks from a file at once.", + "parameters": { + "type": "object", + "properties": { + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + }, + "query": { + "type": "string", + "description": "A complete question about what you want to understand. Ask as if talking to a colleague: 'How does X work?', 'What happens when Y?', 'Where is Z handled?'" + }, + "target_directories": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Prefix directory paths to limit search scope (single directory only, no glob patterns)" + } + }, + "required": [ + "explanation", + "query", + "target_directories" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "run_terminal_cmd", + "description": "PROPOSE a command to run on behalf of the user.\nNote that the user may have to approve the command before it is executed.\nThe user may reject it if it is not to their liking, or may modify the command before approving it. If they do change it, take those changes into account.\nIn using these tools, adhere to the following guidelines:\n1. Before starting servers or long-running processes, list the terminals folder to check if they are already running in existing terminals.\n2. Based on the contents of the conversation, you will be told if you are in the same shell as a previous step or a different shell.\n3. If in a new shell, you should `cd` to the appropriate directory and do necessary setup in addition to running the command. By default, the shell will initialize in the project root.\n4. If in the same shell, LOOK IN CHAT HISTORY for your current working directory. The environment also persists (e.g. exported env vars, venv/nvm activations).\n5. For ANY commands that would require user interaction, ASSUME THE USER IS NOT AVAILABLE TO INTERACT and PASS THE NON-INTERACTIVE FLAGS (e.g. --yes for npx).\n6. For commands that are long running/expected to run indefinitely until interruption, please run them in the background. To run jobs in the background, set `is_background` to true rather than changing the details of the command.\n\nBy default, your commands will run in a sandbox. The sandbox allows most writes to the workspace and reads to the rest of the filesystem. Network access, modifications to git state and modifications to ignored files are disallowed. Reads to git state are allowed. Some other syscalls are also disallowed like access to USB devices. Syscalls that attempt forbidden operations will fail and not all programs will surface these errors in a useful way.\nFiles that are ignored by .gitignore or .cursorignore are not accessible to the command. If you need to access a file that is ignored, you will need to request \"all\" permissions to disable sandboxing.\nThe required_permissions argument is used to request additional permissions. If you know you will need a permission, request it. Requesting permissions will slow down the command execution as it will ask the user for approval. Do not hesitate to request permissions if you are certain you need them.\nThe following permissions are supported:\n- network: Grants broad network access to run a server or contact the internet. Needed for package installs, API calls, hosting servers and fetching dependencies.\n- git_write: Allows write access to .git directories. Required if you want to make commits, checkout a branch or otherwise modify any git state. Not required for read-only commands like git status or git log.\n- all: Disables the sandbox entirely. If all is requested the command will not run in a sandbox and the sandbox cannot impact the result of the command.\nOnly request permissions when they are actually needed for the command to succeed. Most file operations, reading, and local builds work fine in the default sandbox.\nMake sure to request git_write permissions if you need to make changes to the git repository, including staging, unstaging or committing.\nIf you think a command failed due to sandbox restrictions, run the command again with the required_permissions argument to request what you need. Don't change the code, just request the permissions.", + "parameters": { + "type": "object", + "properties": { + "command": { + "type": "string", + "description": "The terminal command to execute" + }, + "is_background": { + "type": "boolean", + "description": "Whether the command should be run in the background" + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this command needs to be run and how it contributes to the goal." + }, + "required_permissions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "git_write", + "network", + "all" + ] + }, + "description": "Optional list of permissions to request if the command needs them (git_write, network, all)." + } + }, + "required": [ + "command", + "is_background" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "grep", + "description": "A powerful search tool built on ripgrep\n\nUsage:\n- Prefer grep for exact symbol/string searches. Whenever possible, use this instead of terminal grep/rg. This tool is faster and respects .gitignore/.cursorignore.\n- Supports full regex syntax, e.g. \"log.*Error\", \"function\\s+\\w+\". Ensure you escape special chars to get exact matches, e.g. \"functionCall\\(\"\n- Avoid overly broad glob patterns (e.g., '--glob *') as they bypass .gitignore rules and may be slow\n- Only use 'type' (or 'glob' for file types) when certain of the file type needed. Note: import paths may not match source file types (.js vs .ts)\n- Output modes: \"content\" shows matching lines (default), \"files_with_matches\" shows only file paths, \"count\" shows match counts per file\n- Pattern syntax: Uses ripgrep (not grep) - literal braces need escaping (e.g. use interface\\{\\} to find interface{} in Go code)\n- Multiline matching: By default patterns match within single lines only. For cross-line patterns like struct \\{[\\s\\S]*?field, use multiline: true\n- Results are capped for responsiveness; truncated results show \"at least\" counts.\n- Content output follows ripgrep format: '-' for context lines, ':' for match lines, and all lines grouped by file.\n- Unsaved or out of workspace active editors are also searched and show \"(unsaved)\" or \"(out of workspace)\". Use absolute paths to read/edit these files.", + "parameters": { + "type": "object", + "properties": { + "pattern": { + "type": "string", + "description": "The regular expression pattern to search for in file contents (rg --regexp)" + }, + "path": { + "type": "string", + "description": "File or directory to search in (rg pattern -- PATH). Defaults to Cursor workspace roots." + }, + "glob": { + "type": "string", + "description": "Glob pattern (rg --glob GLOB -- PATH) to filter files (e.g. \"*.js\", \"*.{ts,tsx}\")." + }, + "output_mode": { + "type": "string", + "description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"content\".", + "enum": [ + "content", + "files_with_matches", + "count" + ] + }, + "-B": { + "type": "number", + "description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise." + }, + "-A": { + "type": "number", + "description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise." + }, + "-C": { + "type": "number", + "description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise." + }, + "-i": { + "type": "boolean", + "description": "Case insensitive search (rg -i) Defaults to false" + }, + "type": { + "type": "string", + "description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than glob for standard file types." + }, + "head_limit": { + "type": "number", + "description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). When unspecified, shows all ripgrep results." + }, + "multiline": { + "type": "boolean", + "description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false." + } + }, + "required": [ + "pattern" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "delete_file", + "description": "Deletes a file at the specified path. The operation will fail gracefully if:\n - The file doesn't exist\n - The operation is rejected for security reasons\n - The file cannot be deleted", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to delete, relative to the workspace root." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + }, + "required": [ + "target_file" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "web_search", + "description": "Search the web for real-time information about any topic. Use this tool when you need up-to-date information that might not be available in your training data, or when you need to verify current facts. The search results will include relevant snippets and URLs from web pages. This is particularly useful for questions about current events, technology updates, or any topic that requires recent information.", + "parameters": { + "type": "object", + "required": [ + "search_term" + ], + "properties": { + "search_term": { + "type": "string", + "description": "The search term to look up on the web. Be specific and include relevant keywords for better results. For technical queries, include version numbers or dates if relevant." + }, + "explanation": { + "type": "string", + "description": "One sentence explanation as to why this tool is being used, and how it contributes to the goal." + } + } + } + } + }, + { + "type": "function", + "function": { + "name": "read_lints", + "description": "Read and display linter errors from the current workspace. You can provide paths to specific files or directories, or omit the argument to get diagnostics for all files.\n\n- If a file path is provided, returns diagnostics for that file only\n- If a directory path is provided, returns diagnostics for all files within that directory\n- If no path is provided, returns diagnostics for all files in the workspace\n- This tool can return linter errors that were already present before your edits, so avoid calling it with a very wide scope of files\n- NEVER call this tool on a file unless you've edited it or are about to edit it", + "parameters": { + "type": "object", + "properties": { + "paths": { + "description": "Optional. An array of paths to files or directories to read linter errors for. You can use either relative paths in the workspace or absolute paths. If provided, returns diagnostics for the specified files/directories only. If not provided, returns diagnostics for all files in the workspace.", + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [] + } + } + }, + { + "type": "function", + "function": { + "name": "todo_write", + "description": "Use this tool to create and manage a structured task list for your current coding session. This helps track progress, organize complex tasks, and demonstrate thoroughness.\n\nNote: Other than when first creating todos, don't tell the user you're updating todos, just do it.\n\n### When to Use This Tool\n\nUse proactively for:\n1. Complex multi-step tasks (3+ distinct steps)\n2. Non-trivial tasks requiring careful planning\n3. User explicitly requests todo list\n4. User provides multiple tasks (numbered/comma-separated)\n5. After receiving new instructions - capture requirements as todos (use merge=false to add new ones)\n6. After completing tasks - mark complete with merge=true and add follow-ups\n7. When starting new tasks - mark as in_progress (ideally only one at a time)\n\n### When NOT to Use\n\nSkip for:\n1. Single, straightforward tasks\n2. Trivial tasks with no organizational benefit\n3. Tasks completable in < 3 trivial steps\n4. Purely conversational/informational requests\n5. Todo items should NOT include operational actions done in service of higher-level tasks.\n\nNEVER INCLUDE THESE IN TODOS: linting; testing; searching or examining the codebase.\n\n### Examples\n\n\n User: Add dark mode toggle to settings\n Assistant:\n - *Creates todo list:*\n 1. Add state management [in_progress]\n 2. Implement styles\n 3. Create toggle component\n 4. Update components\n - [Immediately begins working on todo 1 in the same tool call batch]\n\n Multi-step feature with dependencies.\n\n\n\n\n User: Rename getCwd to getCurrentWorkingDirectory across my project\n Assistant: *Searches codebase, finds 15 instances across 8 files*\n *Creates todo list with specific items for each file that needs updating*\n\n\n Complex refactoring requiring systematic tracking across multiple files.\n\n\n\n\n User: Implement user registration, product catalog, shopping cart, checkout flow.\n Assistant: *Creates todo list breaking down each feature into specific tasks*\n\n\n Multiple complex features provided as list requiring organized task management.\n\n\n\n\n User: Optimize my React app - it's rendering slowly.\n Assistant: *Analyzes codebase, identifies issues*\n *Creates todo list: 1) Memoization, 2) Virtualization, 3) Image optimization, 4) Fix state loops, 5) Code splitting*\n\n\n Performance optimization requires multiple steps across different components.\n\n\n\n### Examples of When NOT to Use the Todo List\n\n\n User: What does git status do?\n Assistant: Shows current state of working directory and staging area...\n\n\n Informational request with no coding task to complete.\n\n\n\n\n User: Add comment to calculateTotal function.\n Assistant: *Uses edit tool to add comment*\n\n\n Single straightforward task in one location.\n\n\n\n\n User: Run npm install for me.\n Assistant: *Executes npm install* Command completed successfully...\n\n\n Single command execution with immediate results.\n\n\n\n### Task States and Management\n\n1. **Task States:**\n - pending: Not yet started\n - in_progress: Currently working on\n - completed: Finished successfully\n - cancelled: No longer needed\n\n2. **Task Management:**\n - Update status in real-time\n - Mark complete IMMEDIATELY after finishing\n - Only ONE task in_progress at a time\n - Complete current tasks before starting new ones\n\n3. **Task Breakdown:**\n - Create specific, actionable items\n - Break complex tasks into manageable steps\n - Use clear, descriptive names\n\n4. **Parallel Todo Writes:**\n - Prefer creating the first todo as in_progress\n - Start working on todos by using tool calls in the same tool call batch as the todo write\n - Batch todo updates with other tool calls for better latency and lower costs for the user\n\nWhen in doubt, use this tool. Proactive task management demonstrates attentiveness and ensures complete requirements.", + "parameters": { + "type": "object", + "properties": { + "merge": { + "type": "boolean", + "description": "Whether to merge the todos with the existing todos. If true, the todos will be merged into the existing todos based on the id field. You can leave unchanged properties undefined. If false, the new todos will replace the existing todos." + }, + "todos": { + "type": "array", + "description": "Array of todo items to write to the workspace", + "items": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The description/content of the todo item", + "maxLength": 70 + }, + "status": { + "type": "string", + "enum": [ + "pending", + "in_progress", + "completed", + "cancelled" + ], + "description": "The current status of the todo item" + }, + "id": { + "type": "string", + "description": "Unique identifier for the todo item" + } + }, + "required": [ + "content", + "status", + "id" + ] + }, + "minItems": 2 + } + }, + "required": [ + "merge", + "todos" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "search_replace", + "description": "Replaces text within a file. By default, replaces a single occurrence, but can replace all occurrences when `replace_all` is specified. This tool requires providing significant context around the change to ensure precise targeting. Always read the file's current content before attempting a text replacement.\n\nExpectation for required parameters:\n1. `old_string` MUST be the exact literal text to replace (including all whitespace, indentation, newlines, and surrounding code etc.).\n2. `new_string` MUST be the exact literal text to replace `old_string` with (also including all whitespace, indentation, newlines, and surrounding code etc.). Ensure the resulting code is correct and idiomatic.\n3. NEVER escape `old_string` or `new_string`, that would break the exact literal text requirement. If you are confused why your edit seems to be correct and is not working, try removing all escape characters.\n\nImportant: If ANY of the above are not satisfied, the tool will fail. CRITICAL for old_string: Must uniquely identify the single instance to change. Include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string matches multiple locations, or does not match exactly, the tool will fail.\n\n4. Prefer to break down complex and long changes into multiple smaller atomic calls to this tool. Always check the content of the file after changes or not finding a string to match.\n\nMultiple replacements: Set `replace_all: true` to replace EVERY exact occurrence of `old_string` in the file. Context is not strictly required if the string is unique enough (e.g. a specific variable name), but be careful not to match unintended partial strings. Avoid using when there are no matches in a file.", + "parameters": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument." + }, + "replace_all": { + "type": "boolean", + "description": "Set this to true when you want to replace all occurences of `old_string` in the file. Defaults to false." + }, + "new_string": { + "type": "string", + "description": "The exact literal text to replace `old_string` with, unescaped. Provide the EXACT text. Ensure the resulting code is correct and idiomatic." + }, + "old_string": { + "type": "string", + "description": "The exact literal text to replace, unescaped. For single replacements (default), include at least 3 lines of context BEFORE and AFTER the target text, matching whitespace and indentation precisely. If this string is not the exact literal text (i.e. you escaped it) or does not match exactly, the tool will fail." + } + }, + "required": [ + "file_path", + "old_string", + "new_string" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "write", + "description": "Writes a file to the local filesystem.\n\nUsage:\n- This tool will overwrite the existing file if there is one at the provided path.\n- If this is an existing file, you MUST use the read_file tool first to read the file's contents.\n- ALWAYS prefer editing existing files in the codebase. NEVER write new files unless explicitly required.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.", + "parameters": { + "type": "object", + "properties": { + "file_path": { + "type": "string", + "description": "The path to the file to modify. Always specify the target file as the first argument. You can use either a relative path in the workspace or an absolute path." + }, + "contents": { + "type": "string", + "description": "The contents of the file to write" + } + }, + "required": [ + "file_path", + "contents" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "read_file", + "description": "Reads a file from the local filesystem. You can access any file directly by using this tool.\nIf the User provides a path to a file assume that path is valid. Otherwise, you should try to only read a file when you are confident it exists, generally because you have seen it in the result of another tool call.\n\nUsage:\n- You can optionally specify a line offset and limit (especially handy for long files), but it's recommended to read the whole file by not providing these parameters.\n- If the file is too big to read all at once, the tool will error; please try again using an adjusted offset and limit. Don't be conservative, prefer to read lots of the file; estimate based on the token and line counts how much you may read.\n- Lines in the output are numbered starting at 1, using following format: LINE_NUMBER|LINE_CONTENT.\n- You have the capability to call multiple tools in a single response. It is always better to read multiple files as a batch that are potentially useful.\n- If you read a file that exists but has empty contents you will receive 'File is empty.'.\n\nImage Support:\n- This tool can also read image files when called with the appropriate path.\n- Supported image formats: jpeg/jpg, png, gif, webp.", + "parameters": { + "type": "object", + "properties": { + "target_file": { + "type": "string", + "description": "The path of the file to read. You can use either a relative path in the workspace or an absolute path. If an absolute path is provided, it will be preserved as is." + }, + "offset": { + "type": "integer", + "description": "The line number to start reading from. Only provide if the file is too large to read at once." + }, + "limit": { + "type": "integer", + "description": "The number of lines to read. Only provide if the file is too large to read at once." + } + }, + "required": [ + "target_file" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "list_dir", + "description": "Lists files and directories in a given path.\nThe 'target_directory' parameter can be relative to the workspace root or absolute.\nYou can optionally provide an array of glob patterns to ignore with the \"ignore_globs\" parameter.\n\nOther details:\n- The result does not display dot-files and dot-directories.\n", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to list contents of." + }, + "ignore_globs": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Optional array of glob patterns to ignore.\nAll patterns match anywhere in the target directory. Patterns not starting with \"**/\" are automatically prepended with \"**/\".\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - ignore all .js files\n\t- \"**/node_modules/**\" - ignore all node_modules directories\n\t- \"**/test/**/test_*.ts\" - ignore all test_*.ts files in any test directory\n" + } + }, + "required": [ + "target_directory" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "glob_file_search", + "description": "\nTool to search for files matching a glob pattern\n\n- Works fast with codebases of any size\n- Returns matching file paths sorted by modification time\n- Use this tool when you need to find files by name patterns\n- You have the capability to call multiple tools in a single response. It is always better to speculatively perform multiple searches that are potentially useful as a batch.\n", + "parameters": { + "type": "object", + "properties": { + "target_directory": { + "type": "string", + "description": "Path to directory to search for files in. If not provided, defaults to Cursor workspace roots." + }, + "glob_pattern": { + "type": "string", + "description": "The glob pattern to match files against.\nPatterns not starting with \"**/\" are automatically prepended with \"**/\" to enable recursive searching.\n\nExamples:\n\t- \"*.js\" (becomes \"**/*.js\") - find all .js files\n\t- \"**/node_modules/**\" - find all node_modules directories\n\t- \"**/test/**/test_*.ts\" - find all test_*.ts files in any test directory\n" + } + }, + "required": [ + "glob_pattern" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "list_mcp_resources", + "description": "List available resources from configured MCP servers. Each returned resource will include all standard MCP resource fields plus a 'server' field indicating which server the resource belongs to.", + "parameters": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "Optional server identifier to filter resources by. If not provided, resources from all servers will be returned." + } + }, + "required": [] + } + } + }, + { + "type": "function", + "function": { + "name": "fetch_mcp_resource", + "description": "Reads a specific resource from an MCP server, identified by server name and resource URI. Optionally, set downloadPath (relative to the workspace) to save the resource to disk; when set, the resource will be downloaded and not returned to the model.", + "parameters": { + "type": "object", + "properties": { + "server": { + "type": "string", + "description": "The MCP server identifier" + }, + "uri": { + "type": "string", + "description": "The resource URI to read" + }, + "downloadPath": { + "type": "string", + "description": "Optional relative path in the workspace to save the resource to. When set, the resource is written to disk and is not returned to the model." + } + }, + "required": [ + "server", + "uri" + ] + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_navigate", + "description": "Navigate to a URL", + "parameters": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The URL to navigate to" + } + }, + "required": [ + "url" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_navigate_back", + "description": "Go back to the previous page", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_resize", + "description": "Resize the browser window", + "parameters": { + "type": "object", + "properties": { + "width": { + "type": "number", + "description": "Width of the browser window" + }, + "height": { + "type": "number", + "description": "Height of the browser window" + } + }, + "required": [ + "width", + "height" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_snapshot", + "description": "Capture accessibility snapshot of the current page. Use this to get element refs for interactions, not browser_take_screenshot.", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_wait_for", + "description": "Wait for text to appear or disappear or a specified time to pass", + "parameters": { + "type": "object", + "properties": { + "time": { + "type": "number", + "description": "The time to wait in seconds" + }, + "text": { + "type": "string", + "description": "The text to wait for" + }, + "textGone": { + "type": "string", + "description": "The text to wait for to disappear" + } + }, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_press_key", + "description": "Press a key on the keyboard", + "parameters": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Name of the key to press or a character to generate, such as `ArrowLeft` or `a`" + } + }, + "required": [ + "key" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_console_messages", + "description": "Returns all console messages", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_network_requests", + "description": "Returns all network requests since loading the page", + "parameters": { + "type": "object", + "properties": {}, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_click", + "description": "Perform click on a web page", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "doubleClick": { + "type": "boolean", + "description": "Whether to perform a double click instead of a single click" + }, + "button": { + "type": "string", + "enum": [ + "left", + "right", + "middle" + ], + "description": "Button to click, defaults to left" + }, + "modifiers": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "Alt", + "Control", + "ControlOrMeta", + "Meta", + "Shift" + ] + }, + "description": "Modifier keys to press" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_hover", + "description": "Hover over element on page", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "element", + "ref" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_type", + "description": "Type text into editable element", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "text": { + "type": "string", + "description": "Text to type into the element" + }, + "submit": { + "type": "boolean", + "description": "Whether to submit entered text (press Enter after)" + }, + "slowly": { + "type": "boolean", + "description": "Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once." + } + }, + "required": [ + "element", + "ref", + "text" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_select_option", + "description": "Select an option in a dropdown", + "parameters": { + "type": "object", + "properties": { + "element": { + "type": "string", + "description": "Human-readable element description used to obtain permission to interact with the element" + }, + "ref": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array of values to select in the dropdown. This can be a single value or multiple values." + } + }, + "required": [ + "element", + "ref", + "values" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_drag", + "description": "Perform drag and drop between two elements", + "parameters": { + "type": "object", + "properties": { + "startElement": { + "type": "string", + "description": "Human-readable source element description used to obtain the permission to interact with the element" + }, + "startRef": { + "type": "string", + "description": "Exact source element reference from the page snapshot" + }, + "endElement": { + "type": "string", + "description": "Human-readable target element description used to obtain the permission to interact with the element" + }, + "endRef": { + "type": "string", + "description": "Exact target element reference from the page snapshot" + } + }, + "required": [ + "startElement", + "startRef", + "endElement", + "endRef" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_evaluate", + "description": "Evaluate JavaScript expression on page or element", + "parameters": { + "type": "object", + "properties": { + "function": { + "type": "string", + "description": "() => { /* code */ } or (element) => { /* code */ } when element/ref is provided" + }, + "element": { + "type": "string", + "description": "Description of the element, if evaluating on an element" + }, + "ref": { + "type": "string", + "description": "CSS selector to find element, if evaluating on an element" + } + }, + "required": [ + "function" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_fill_form", + "description": "Fill multiple form fields", + "parameters": { + "type": "object", + "properties": { + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Description of the field" + }, + "ref": { + "type": "string", + "description": "CSS selector for the field" + }, + "type": { + "type": "string", + "enum": [ + "textbox", + "checkbox", + "radio", + "combobox", + "slider" + ], + "description": "Type of the field" + }, + "value": { + "type": "string", + "description": "Value to fill in the field. If the field is a checkbox, the value should be `true` or `false`. If the field is a combobox, the value should be the text of the option." + } + }, + "required": [ + "name", + "ref", + "type", + "value" + ], + "additionalProperties": false + }, + "description": "Fields to fill in" + } + }, + "required": [ + "fields" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_handle_dialog", + "description": "Handle a dialog (alert, confirm, prompt)", + "parameters": { + "type": "object", + "properties": { + "accept": { + "type": "boolean", + "description": "Whether to accept the dialog." + }, + "promptText": { + "type": "string", + "description": "The text of the prompt in case of a prompt dialog." + } + }, + "required": [ + "accept" + ], + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_take_screenshot", + "description": "Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.", + "parameters": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "png", + "jpeg" + ], + "default": "png", + "description": "Image format for the screenshot. Default is png." + }, + "filename": { + "type": "string", + "description": "File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified." + }, + "element": { + "type": "string", + "description": "Description of a specific element to screenshot (if omitted, screenshots the page)" + }, + "ref": { + "type": "string", + "description": "CSS selector of a specific element to screenshot (if omitted, screenshots the page)" + }, + "fullPage": { + "type": "boolean", + "description": "When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport." + } + }, + "additionalProperties": false + } + } + }, + { + "type": "function", + "function": { + "name": "mcp_cursor-browser-extension_browser_tabs", + "description": "List, create, close, or select a browser tab.", + "parameters": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "list", + "new", + "close", + "select" + ], + "description": "Operation to perform" + }, + "index": { + "type": "number", + "description": "Tab index, used for close/select. If omitted for close, current tab is closed." + } + }, + "required": [ + "action" + ], + "additionalProperties": false + } + } + } + ], + "tool_choice": "validated", + "extra_body": { + "google": { + "disable_thought_tag": true, + "thinking_config": { + "include_thoughts": true + } + } + }, + "stream": true, + "stream_options": { + "include_usage": true + } +} \ No newline at end of file diff --git a/cursor-problems/upstream-rate-limit-error/response.json b/cursor-problems/upstream-rate-limit-error/response.json new file mode 100644 index 00000000..81184ed3 --- /dev/null +++ b/cursor-problems/upstream-rate-limit-error/response.json @@ -0,0 +1,8 @@ +{ + "error": { + "message": "Upstream request failed", + "type": "rate_limit_exceeded", + "code": 429 + }, + "request_id": "80657fc6-4bca-4cb1-945d-ea65ec8a53c4" +} \ No newline at end of file