Skip to content

Tools section duplicate #45

@hardWorker254

Description

@hardWorker254

When I use local models without a special tool format, Cortex sends a separate tools section in the request structure along with the XML tools, which causes ik_lama.сpp to return UNRECOGNIZED SCHEMA. Changing the name of the model that Cortex doesn't recognize (for example, instead of qwen3-instruct, I write instruct-30b) helps and removes the extra tools section when accessing the server.

Example (instruct-30b):
VERB [ batch_pending_prompt] prompt tokenized | tid="140006447261184" timestamp=1771765505 id_slot=0 id_task=0 n_ctx=32768 n_keep=0 n_prompt_tokens=3838 prompt_tokens="<|im_start|>user\n<SYSTEM_MESSAGE>\nAgent: use tools. WS:/home/prof/proj|Active:none|Open:0 Available tools:\n\n 1. read_file\n Description: Returns full contents of a given file.\n Format:\n <read_file>\nThe FULL path to the file.\n<start_line>Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the beginning of the file.</start_line>\n<end_line>Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the end of the file.</end_line>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </read_file>\n\n 2. ls_dir\n Description: Lists all files and folders in the given URI.\n Format:\n <ls_dir>\nOptional. The FULL path to the folder. Leave this as empty or "" to search all folders.\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </ls_dir>\n\n 3. get_dir_tree\n Description: This is a very effective way to learn about the user's codebase. Returns a tree diagram of all the files and folders in the given folder. \n Format:\n <get_dir_tree>\nThe FULL path to the folder.\n </get_dir_tree>\n\n 4. search_pathnames_only\n Description: Returns all pathnames that match a given query (searches ONLY file names). You should use this when looking for a file with a specific name or path.\n Format:\n <search_pathnames_only>\nYour query for the search.\n<include_pattern>Optional. Only fill this in if you need to limit your search because there were too many results.</include_pattern>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </search_pathnames_only>\n\n 5. search_for_files\n Description: Returns a list of file names whose content matches the given query. The query can be any substring or regex.\n Format:\n <search_for_files>\nYour query for the search.\n<search_in_folder>Optional. Leave as blank by default. ONLY fill this in if your previous search with the same query was truncated. Searches descendants of this folder only.</search_in_folder>\n<is_regex>Optional. Default is false. Whether the query is a regex.</is_regex>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </search_for_files>\n\n 6. search_in_file\n Description: Returns an array of all the start line numbers where the content appears in the file.\n Format:\n <search_in_file>\nThe FULL path to the file.\nThe string or regex to search for in the file.\n<is_regex>Optional. Default is false. Whether the query is a regex.</is_regex>\n </search_in_file>\n\n 7. read_lint_errors\n Description: Use this tool to view all the lint errors on a file.\n Format:\n <read_lint_errors>\nThe FULL path to the file.\n </read_lint_errors>\n\n 8. open_file\n Description: Opens a file in the editor. Use this when the user asks to "open" a file.\n Format:\n <open_file>\nThe FULL path to the file.\n </open_file>\n\n 9. go_to_definition\n Description: Finds the definition of a symbol at a specific position in a file. Returns the location(s) where the symbol is defined.\n Format:\n <go_to_definition>\nThe FULL path to the file.\nThe line number (1-based) where the symbol is located.\nThe column number (1-based) where the symbol is located.\n </go_to_definition>\n\n 10. find_references\n Description: Finds all references to a symbol at a specific position in a file. Returns all locations where the symbol is used.\n Format:\n <find_references>\nThe FULL path to the file.\nThe line number (1-based) where the symbol is located.\nThe column number (1-based) where the symbol is located.\n </find_references>\n\n 11. search_symbols\n Description: Searches for symbols (functions, classes, variables) by name. Can search in a specific file or across the workspace.\n Format:\n <search_symbols>\nThe symbol name or pattern to search for.\nOptional. The file URI to search in. If not provided, searches the entire workspace.\n </search_symbols>\n\n 12. automated_code_review\n Description: Analyzes code in a file for potential issues, bugs, code smells, and suggests improvements. Returns a list of issues with severity and suggestions.\n Format:\n <automated_code_review>\nThe FULL path to the file.\n </automated_code_review>\n\n 13. generate_tests\n Description: Generates unit or integration tests for code in a file. Can generate tests for a specific function or the entire file.\n Format:\n <generate_tests>\nThe FULL path to the file.\n<function_name>Optional. The name of the function to generate tests for. If not provided, generates tests for the entire file.</function_name>\n<test_framework>Optional. The test framework to use (e.g., "jest", "mocha", "pytest"). Defaults to the framework detected from the project.</test_framework>\n </generate_tests>\n\n 14. rename_symbol\n Description: Renames a symbol (function, class, variable) at a specific position and updates all references to it across the codebase.\n Format:\n <rename_symbol>\nThe FULL path to the file.\nThe line number (1-based) where the symbol is located.\nThe column number (1-based) where the symbol is located.\n<new_name>The new name for the symbol.</new_name>\n </rename_symbol>\n\n 15. extract_function\n Description: Extracts a block of code into a new function. Replaces the selected code with a function call.\n Format:\n <extract_function>\nThe FULL path to the file.\n<start_line>The starting line number (1-based) of the code block to extract.</start_line>\n<end_line>The ending line number (1-based) of the code block to extract.</end_line>\n<function_name>The name for the new function.</function_name>\n </extract_function>\n\n 16. create_file_or_folder\n Description: Create a file or folder at the given path. To create a folder, the path MUST end with a trailing slash.\n Format:\n <create_file_or_folder>\nThe FULL path to the file or folder.\n </create_file_or_folder>\n\n 17. delete_file_or_folder\n Description: Delete a file or folder at the given path.\n Format:\n <delete_file_or_folder>\nThe FULL path to the file or folder.\n<is_recursive>Optional. Return true to delete recursively.</is_recursive>\n </delete_file_or_folder>\n\n 18. edit_file\n Description: Edit the contents of a file. You must provide the file's URI as well as a SINGLE string of SEARCH/REPLACE block(s) that will be used to apply the edit.\n Format:\n <edit_file>\nThe FULL path to the file.\n<search_replace_blocks>A string of SEARCH/REPLACE block(s) which will be applied to the given file.\nYour SEARCH/REPLACE blocks string must be formatted as follows:\n<<<<<<< ORIGINAL\n// ... original code goes here\n=======\n// ... final code goes here\n>>>>>>> UPDATED\n\n<<<<<<< ORIGINAL\n// ... original code goes here\n=======\n// ... final code goes here\n>>>>>>> UPDATED\n\n## Guidelines:\n\n1. You may output multiple search replace blocks if needed.\n\n2. The ORIGINAL code in each SEARCH/REPLACE block must EXACTLY match lines in the original file. Do not add or remove any whitespace or comments from the original code.\n\n3. Each ORIGINAL text must be large enough to uniquely identify the change. However, bias towards writing as little as possible.\n\n4. Each ORIGINAL text must be DISJOINT from all other ORIGINAL text.\n\n5. This field is a STRING (not an array).</search_replace_blocks>\n </edit_file>\n\n 19. rewrite_file\n Description: Edits a file, deleting all the old contents and replacing them with your new contents. Use this tool if you want to edit a file you just created.\n Format:\n <rewrite_file>\nThe FULL path to the file.\n<new_content>The new contents of the file. Must be a string.</new_content>\n </rewrite_file>\n\n 20. run_command\n Description: Runs a terminal command and waits for the result (times out after 8s of inactivity). You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.\n Format:\n <run_command>\nThe terminal command to run.\nOptional. The directory in which to run the command. Defaults to the first workspace folder.\n </run_command>\n\n 21. run_nl_command\n Description: Converts a natural language request into a shell command, shows a preview, and executes it after confirmation. Use this when the user asks for terminal operations in plain English (e.g., "list branches", "run tests", "check git status"). The command will be parsed, previewed, and requires approval unless it's low-risk and YOLO mode is enabled. You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.\n Format:\n <run_nl_command>\n<nl_input>Natural language description of the command to run (e.g., "list git branches", "run npm tests", "check current directory").</nl_input>\nOptional. The directory in which to run the command. Defaults to the first workspace folder.\n </run_nl_command>\n\n 22. run_persistent_command\n Description: Runs a terminal command in the persistent terminal that you created with open_persistent_terminal (results after 5 are returned, and command continues running in background). You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.\n Format:\n <run_persistent_command>\nThe terminal command to run.\n<persistent_terminal_id>The ID of the terminal created using open_persistent_terminal.</persistent_terminal_id>\n </run_persistent_command>\n\n 23. open_persistent_terminal\n Description: Use this tool when you want to run a terminal command indefinitely, like a dev server (eg npm run dev), a background listener, etc. Opens a new terminal in the user's environment which will not awaited for or killed.\n Format:\n <open_persistent_terminal>\nOptional. The directory in which to run the command. Defaults to the first workspace folder.\n </open_persistent_terminal>\n\n 24. kill_persistent_terminal\n Description: Interrupts and closes a persistent terminal that you opened with open_persistent_terminal.\n Format:\n <kill_persistent_terminal>\n<persistent_terminal_id>The ID of the persistent terminal.</persistent_terminal_id>\n </kill_persistent_terminal>\n\n 25. web_search\n Description: Searches the web for information. Returns top search results with titles, snippets, and URLs. Use this when the user asks you to search the web, look something up online, or when you need current information beyond your training data.\n Format:\n <web_search>\nThe search query string.\nOptional. Number of results to return (default is 5). Maximum is 10.\nOptional. If true, bypasses cache and fetches fresh results. Default is false.\n </web_search>\n\n 26. browse_url\n Description: Fetches and extracts the main content from a web page. Returns readable text, title, and metadata. Use this after web_search to read the actual content of relevant pages.\n Format:\n <browse_url>\nThe full URL (including http:// or https://) to fetch and extract content from.\nOptional. If true, bypasses cache and fetches fresh content. Default is false.\n </browse_url>\n\n ⚠️⚠️⚠️ CRITICAL: When the user asks you to DO something (like "add an endpoint", "edit a file", "create a file"), you MUST call a tool. DO NOT just describe what to do.\n\n TOOL CALLING FORMAT (use this EXACT format):\n\n 1. When you need to take action, output ONLY a tool call in XML format\n 2. Format: <tool_name>value1value2</tool_name>\n 3. NO explanatory text before the tool call - just output the XML directly\n 4. STOP immediately after the tool call - do not write anything after it\n 5. Wait for the tool result before continuing\n\n CONCRETE EXAMPLES:\n\n Example 1 - Reading a file:\n User: "Read the file src/server.ts"\n Your response should be EXACTLY:\n <read_file>\n src/server.ts\n <start_line>1</start_line>\n <end_line>100</end_line>\n </read_file>\n\n Example 2 - Creating/editing a file:\n User: "Add a dummy endpoint"\n Your response should be:\n Step 1: First search for where endpoints are defined:\n <search_for_files>\n api route endpoint server express\n </search_for_files>\n\n Then after seeing results, read the file and edit it using:\n <edit_file>\n path/to/server.ts\n <search_replace_blocks>\n // ... existing code ...\n app.get('/api/health', (req, res) => { res.json({ status: 'ok' }) })\n </search_replace_blocks>\n </edit_file>\n\n REMEMBER: When user asks you to DO something, start with a tool call immediately. DO NOT explain what you're going to do - JUST DO IT using tools. \nRead before edit.\n\n<repo_guidance>\nYou have access to repository context via <repo_context>. Use it to answer repo-specific questions and make changes. Do not claim that you lack access to the repository or files. When asked what the repo is about, summarize based on README.md, package/product metadata, and top-level docs if present.\n\nIMPORTANT: When referencing code or files from the context, cite them explicitly using the file path and line ranges provided (e.g., "In repoIndexerService.ts:42-56, the function does..."). This helps users verify your answers and navigate to the relevant code.\n</repo_guidance>\n\n<repo_context>\nHere are relevant files and symbols from the codebase:\n1. models:\n thinking-30b:\n cmd: /home/prof/ik_llama.cpp/bin/llama-server --port ${PORT} --ctx-size 32768 -m /home/prof/models/Qwen3-128k-30BA3B-NEO-MAX-PLUS-IQ2_XS.gguf --jinja --threads 16 -tb 16 -b 8192 -ub 8192 -cnv -ctv f16 -ctk f16 --temp 3 --top-p 0.95 --top-k 100 --min-p 0.5 -ger\n moonlight:\n cmd: /home/prof/ik_llama.cpp/bin/llama-server --port ${PORT} --ctx-size 32768 -m /home/prof/models/Moonlight-16B-A3B-Instruct-IQ4_XS.gguf --threads 16 --jinja -tb 16 -b 8192 -ub 8192 -cnv -ctv f16 -ctk f16 -ger\n instruct-30b:\n cmd: /home/prof/ik_llama.cpp/bin/llama-server --port ${PORT} --ctx-size 32768 -m /home/prof/models/Qwen3-30B-A3B-Deepseek-Distill-Instruct-2507.i1-IQ2_XS.gguf --threads 16 -tb 16 -b 8192 -ub 8192 -cnv -ctv f16 -ctk f16 --temp 0.7 --top-p 0.8 --top-k 20 --min-p 0 -ger --chat-template-file /home/prof/models/openai.jinja --jinja\n</repo_context>\n</SYSTEM_MESSAGE>\nRemove file /home/prof/proj/python/m.py<|im_end|>\n<|im_start|>assistant\n"

Qwen3-instruct:
VERB [ log_server_request] request | tid="140196282623680" timestamp=1771765602 request="{\n "model": "qwen3-instruct",\n "messages": [\n {\n "role": "user",\n "content": [\n {\n "type": "text",\n "text": "<SYSTEM_MESSAGE>\nAgent: use tools. WS:/home/prof/proj|Active:settings|Open:1 Available tools:\n\n 1. read_file\n Description: Returns full contents of a given file.\n Format:\n <read_file>\nThe FULL path to the file.\n<start_line>Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the beginning of the file.</start_line>\n<end_line>Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the end of the file.</end_line>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </read_file>\n\n 2. ls_dir\n Description: Lists all files and folders in the given URI.\n Format:\n <ls_dir>\nOptional. The FULL path to the folder. Leave this as empty or \"\" to search all folders.\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </ls_dir>\n\n 3. get_dir_tree\n Description: This is a very effective way to learn about the user's codebase. Returns a tree diagram of all the files and folders in the given folder. \n Format:\n <get_dir_tree>\nThe FULL path to the folder.\n </get_dir_tree>\n\n 4. search_pathnames_only\n Description: Returns all pathnames that match a given query (searches ONLY file names). You should use this when looking for a file with a specific name or path.\n Format:\n <search_pathnames_only>\nYour query for the search.\n<include_pattern>Optional. Only fill this in if you need to limit your search because there were too many results.</include_pattern>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </search_pathnames_only>\n\n 5. search_for_files\n Description: Returns a list of file names whose content matches the given query. The query can be any substring or regex.\n Format:\n <search_for_files>\nYour query for the search.\n<search_in_folder>Optional. Leave as blank by default. ONLY fill this in if your previous search with the same query was truncated. Searches descendants of this folder only.</search_in_folder>\n<is_regex>Optional. Default is false. Whether the query is a regex.</is_regex>\n<page_number>Optional. The page number of the result. Default is 1.</page_number>\n </search_for_files>\n\n 6. search_in_file\n Description: Returns an array of all the start line numbers where the content appears in the file.\n Format:\n <search_in_file>\nThe FULL path to the file.\nThe string or regex to search for in the file.\n<is_regex>Optional. Default is false. Whether the query is a regex.</is_regex>\n </search_in_file>\n\n 7. read_lint_errors\n Description: Use this tool to view all the lint errors on a file.\n Format:\n <read_lint_errors>\nThe FULL path to the file.\n </read_lint_errors>\n\n 8. open_file\n Description: Opens a file in the editor. Use this when the user asks to \"open\" a file.\n Format:\n <open_file>\nThe FULL path to the file.\n </open_file>\n\n 9. go_to_definition\n Description: Finds the definition of a symbol at a specific position in a file. Returns the location(s) where the symbol is defined.\n Format:\n <go_to_definition>\nThe FULL path to the file.\nThe line number (1-based) where the symbol is located.\nThe column number (1-based) where the symbol is located.\n </go_to_definition>\n\n 10. find_references\n Description: Finds all references to a symbol at a specific position in a file. Returns all locations where the symbol is used.\n Format:\n <find_references>\nThe FULL path to the file.\nThe line number (1-based) where the symbol is located.\nThe column number (1-based) where the symbol is located.\n </find_references>\n\n 11. search_symbols\n Description: Searches for symbols (functions, classes, variables) by name. Can search in a specific file or across the workspace.\n Format:\n <search_symbols>\nThe symbol name or pattern to search for.\nOptional. The file URI to search in. If not provided, searches the entire workspace.\n </search_symbols>\n\n 12. automated_code_review\n Description: Analyzes code in a file for potential issues, bugs, code smells, and suggests improvements. Returns a list of issues with severity and suggestions.\n Format:\n <automated_code_review>\nThe FULL path to the file.\n </automated_code_review>\n\n 13. generate_tests\n Description: Generates unit or integration tests for code in a file. Can generate tests for a specific function or the entire file.\n Format:\n <generate_tests>\nThe FULL path to the file.\n<function_name>Optional. The name of the function to generate tests for. If not provided, generates tests for the entire file.</function_name>\n<test_framework>Optional. The test...\n</SYSTEM_MESSAGE>\nУдали файл /home/prof/proj/python/m.py"\n }\n ]\n }\n ],\n "stream": true,\n "tools": [\n {\n "type": "function",\n "function": {\n "name": "read_file",\n "description": "Returns full contents of a given file.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "start_line": {\n "description": "Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the beginning of the file."\n },\n "end_line": {\n "description": "Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the end of the file."\n },\n "page_number": {\n "description": "Optional. The page number of the result. Default is 1."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "ls_dir",\n "description": "Lists all files and folders in the given URI.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "Optional. The FULL path to the folder. Leave this as empty or \"\" to search all folders."\n },\n "page_number": {\n "description": "Optional. The page number of the result. Default is 1."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "get_dir_tree",\n "description": "This is a very effective way to learn about the user's codebase. Returns a tree diagram of all the files and folders in the given folder. ",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the folder."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "search_pathnames_only",\n "description": "Returns all pathnames that match a given query (searches ONLY file names). You should use this when looking for a file with a specific name or path.",\n "parameters": {\n "type": "object",\n "properties": {\n "query": {\n "description": "Your query for the search."\n },\n "include_pattern": {\n "description": "Optional. Only fill this in if you need to limit your search because there were too many results."\n },\n "page_number": {\n "description": "Optional. The page number of the result. Default is 1."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "search_for_files",\n "description": "Returns a list of file names whose content matches the given query. The query can be any substring or regex.",\n "parameters": {\n "type": "object",\n "properties": {\n "query": {\n "description": "Your query for the search."\n },\n "search_in_folder": {\n "description": "Optional. Leave as blank by default. ONLY fill this in if your previous search with the same query was truncated. Searches descendants of this folder only."\n },\n "is_regex": {\n "description": "Optional. Default is false. Whether the query is a regex."\n },\n "page_number": {\n "description": "Optional. The page number of the result. Default is 1."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "search_in_file",\n "description": "Returns an array of all the start line numbers where the content appears in the file.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "query": {\n "description": "The string or regex to search for in the file."\n },\n "is_regex": {\n "description": "Optional. Default is false. Whether the query is a regex."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "read_lint_errors",\n "description": "Use this tool to view all the lint errors on a file.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "open_file",\n "description": "Opens a file in the editor. Use this when the user asks to \"open\" a file.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "go_to_definition",\n "description": "Finds the definition of a symbol at a specific position in a file. Returns the location(s) where the symbol is defined.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "line": {\n "description": "The line number (1-based) where the symbol is located."\n },\n "column": {\n "description": "The column number (1-based) where the symbol is located."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "find_references",\n "description": "Finds all references to a symbol at a specific position in a file. Returns all locations where the symbol is used.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "line": {\n "description": "The line number (1-based) where the symbol is located."\n },\n "column": {\n "description": "The column number (1-based) where the symbol is located."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "search_symbols",\n "description": "Searches for symbols (functions, classes, variables) by name. Can search in a specific file or across the workspace.",\n "parameters": {\n "type": "object",\n "properties": {\n "query": {\n "description": "The symbol name or pattern to search for."\n },\n "uri": {\n "description": "Optional. The file URI to search in. If not provided, searches the entire workspace."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "automated_code_review",\n "description": "Analyzes code in a file for potential issues, bugs, code smells, and suggests improvements. Returns a list of issues with severity and suggestions.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "generate_tests",\n "description": "Generates unit or integration tests for code in a file. Can generate tests for a specific function or the entire file.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "function_name": {\n "description": "Optional. The name of the function to generate tests for. If not provided, generates tests for the entire file."\n },\n "test_framework": {\n "description": "Optional. The test framework to use (e.g., \"jest\", \"mocha\", \"pytest\"). Defaults to the framework detected from the project."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "rename_symbol",\n "description": "Renames a symbol (function, class, variable) at a specific position and updates all references to it across the codebase.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "line": {\n "description": "The line number (1-based) where the symbol is located."\n },\n "column": {\n "description": "The column number (1-based) where the symbol is located."\n },\n "new_name": {\n "description": "The new name for the symbol."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "extract_function",\n "description": "Extracts a block of code into a new function. Replaces the selected code with a function call.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "start_line": {\n "description": "The starting line number (1-based) of the code block to extract."\n },\n "end_line": {\n "description": "The ending line number (1-based) of the code block to extract."\n },\n "function_name": {\n "description": "The name for the new function."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "create_file_or_folder",\n "description": "Create a file or folder at the given path. To create a folder, the path MUST end with a trailing slash.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file or folder."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "delete_file_or_folder",\n "description": "Delete a file or folder at the given path.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file or folder."\n },\n "is_recursive": {\n "description": "Optional. Return true to delete recursively."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "edit_file",\n "description": "Edit the contents of a file. You must provide the file's URI as well as a SINGLE string of SEARCH/REPLACE block(s) that will be used to apply the edit.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "search_replace_blocks": {\n "description": "A string of SEARCH/REPLACE block(s) which will be applied to the given file.\nYour SEARCH/REPLACE blocks string must be formatted as follows:\n<<<<<<< ORIGINAL\n// ... original code goes here\n=======\n// ... final code goes here\n>>>>>>> UPDATED\n\n<<<<<<< ORIGINAL\n// ... original code goes here\n=======\n// ... final code goes here\n>>>>>>> UPDATED\n\n## Guidelines:\n\n1. You may output multiple search replace blocks if needed.\n\n2. The ORIGINAL code in each SEARCH/REPLACE block must EXACTLY match lines in the original file. Do not add or remove any whitespace or comments from the original code.\n\n3. Each ORIGINAL text must be large enough to uniquely identify the change. However, bias towards writing as little as possible.\n\n4. Each ORIGINAL text must be DISJOINT from all other ORIGINAL text.\n\n5. This field is a STRING (not an array)."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "rewrite_file",\n "description": "Edits a file, deleting all the old contents and replacing them with your new contents. Use this tool if you want to edit a file you just created.",\n "parameters": {\n "type": "object",\n "properties": {\n "uri": {\n "description": "The FULL path to the file."\n },\n "new_content": {\n "description": "The new contents of the file. Must be a string."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "run_command",\n "description": "Runs a terminal command and waits for the result (times out after 8s of inactivity). You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.",\n "parameters": {\n "type": "object",\n "properties": {\n "command": {\n "description": "The terminal command to run."\n },\n "cwd": {\n "description": "Optional. The directory in which to run the command. Defaults to the first workspace folder."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "run_nl_command",\n "description": "Converts a natural language request into a shell command, shows a preview, and executes it after confirmation. Use this when the user asks for terminal operations in plain English (e.g., \"list branches\", \"run tests\", \"check git status\"). The command will be parsed, previewed, and requires approval unless it's low-risk and YOLO mode is enabled. You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.",\n "parameters": {\n "type": "object",\n "properties": {\n "nl_input": {\n "description": "Natural language description of the command to run (e.g., \"list git branches\", \"run npm tests\", \"check current directory\")."\n },\n "cwd": {\n "description": "Optional. The directory in which to run the command. Defaults to the first workspace folder."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "run_persistent_command",\n "description": "Runs a terminal command in the persistent terminal that you created with open_persistent_terminal (results after 5 are returned, and command continues running in background). You can use this tool to run any command: sed, grep, etc. Do not edit any files with this tool; use edit_file instead. When working with git and other tools that open an editor (e.g. git diff), you should pipe to cat to get all results and not get stuck in vim.",\n "parameters": {\n "type": "object",\n "properties": {\n "command": {\n "description": "The terminal command to run."\n },\n "persistent_terminal_id": {\n "description": "The ID of the terminal created using open_persistent_terminal."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "open_persistent_terminal",\n "description": "Use this tool when you want to run a terminal command indefinitely, like a dev server (eg npm run dev), a background listener, etc. Opens a new terminal in the user's environment which will not awaited for or killed.",\n "parameters": {\n "type": "object",\n "properties": {\n "cwd": {\n "description": "Optional. The directory in which to run the command. Defaults to the first workspace folder."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "kill_persistent_terminal",\n "description": "Interrupts and closes a persistent terminal that you opened with open_persistent_terminal.",\n "parameters": {\n "type": "object",\n "properties": {\n "persistent_terminal_id": {\n "description": "The ID of the persistent terminal."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "web_search",\n "description": "Searches the web for information. Returns top search results with titles, snippets, and URLs. Use this when the user asks you to search the web, look something up online, or when you need current information beyond your training data.",\n "parameters": {\n "type": "object",\n "properties": {\n "query": {\n "description": "The search query string."\n },\n "k": {\n "description": "Optional. Number of results to return (default is 5). Maximum is 10."\n },\n "refresh": {\n "description": "Optional. If true, bypasses cache and fetches fresh results. Default is false."\n }\n }\n }\n }\n },\n {\n "type": "function",\n "function": {\n "name": "browse_url",\n "description": "Fetches and extracts the main content from a web page. Returns readable text, title, and metadata. Use this after web_search to read the actual content of relevant pages.",\n "parameters": {\n "type": "object",\n "properties": {\n "url": {\n "description": "The full URL (including http:// or https://) to fetch and extract content from."\n },\n "refresh": {\n "description": "Optional. If true, bypasses cache and fetches fresh content. Default is false."\n }\n }\n }\n }\n }\n ]\n}"

Here is an error

response="{"error":{"code":500,"message":"JSON schema conversion failed:\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the beginning of the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the end of the file.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the beginning of the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Do NOT fill this field in unless you were specifically given exact line numbers to search. Defaults to the end of the file.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"Optional. The FULL path to the folder. Leave this as empty or \\\"\\\" to search all folders.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"Optional. The FULL path to the folder. Leave this as empty or \\\"\\\" to search all folders.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the folder.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the folder.\"}\nUnrecognized schema: {\"description\":\"Your query for the search.\"}\nUnrecognized schema: {\"description\":\"Optional. Only fill this in if you need to limit your search because there were too many results.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"Your query for the search.\"}\nUnrecognized schema: {\"description\":\"Optional. Only fill this in if you need to limit your search because there were too many results.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"Your query for the search.\"}\nUnrecognized schema: {\"description\":\"Optional. Leave as blank by default. ONLY fill this in if your previous search with the same query was truncated. Searches descendants of this folder only.\"}\nUnrecognized schema: {\"description\":\"Optional. Default is false. Whether the query is a regex.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"Your query for the search.\"}\nUnrecognized schema: {\"description\":\"Optional. Leave as blank by default. ONLY fill this in if your previous search with the same query was truncated. Searches descendants of this folder only.\"}\nUnrecognized schema: {\"description\":\"Optional. Default is false. Whether the query is a regex.\"}\nUnrecognized schema: {\"description\":\"Optional. The page number of the result. Default is 1.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The string or regex to search for in the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Default is false. Whether the query is a regex.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The string or regex to search for in the file.\"}\nUnrecognized schema: {\"description\":\"Optional. Default is false. Whether the query is a regex.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The symbol name or pattern to search for.\"}\nUnrecognized schema: {\"description\":\"Optional. The file URI to search in. If not provided, searches the entire workspace.\"}\nUnrecognized schema: {\"description\":\"The symbol name or pattern to search for.\"}\nUnrecognized schema: {\"description\":\"Optional. The file URI to search in. If not provided, searches the entire workspace.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"Optional. The name of the function to generate tests for. If not provided, generates tests for the entire file.\"}\nUnrecognized schema: {\"description\":\"Optional. The test framework to use (e.g., \\\"jest\\\", \\\"mocha\\\", \\\"pytest\\\"). Defaults to the framework detected from the project.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"Optional. The name of the function to generate tests for. If not provided, generates tests for the entire file.\"}\nUnrecognized schema: {\"description\":\"Optional. The test framework to use (e.g., \\\"jest\\\", \\\"mocha\\\", \\\"pytest\\\"). Defaults to the framework detected from the project.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The new name for the symbol.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The line number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The column number (1-based) where the symbol is located.\"}\nUnrecognized schema: {\"description\":\"The new name for the symbol.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The starting line number (1-based) of the code block to extract.\"}\nUnrecognized schema: {\"description\":\"The ending line number (1-based) of the code block to extract.\"}\nUnrecognized schema: {\"description\":\"The name for the new function.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The starting line number (1-based) of the code block to extract.\"}\nUnrecognized schema: {\"description\":\"The ending line number (1-based) of the code block to extract.\"}\nUnrecognized schema: {\"description\":\"The name for the new function.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file or folder.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file or folder.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file or folder.\"}\nUnrecognized schema: {\"description\":\"Optional. Return true to delete recursively.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file or folder.\"}\nUnrecognized schema: {\"description\":\"Optional. Return true to delete recursively.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"A string of SEARCH/REPLACE block(s) which will be applied to the given file.\\nYour SEARCH/REPLACE blocks string must be formatted as follows:\\n<<<<<<< ORIGINAL\\n// ... original code goes here\\n=======\\n// ... final code goes here\\n>>>>>>> UPDATED\\n\\n<<<<<<< ORIGINAL\\n// ... original code goes here\\n=======\\n// ... final code goes here\\n>>>>>>> UPDATED\\n\\n## Guidelines:\\n\\n1. You may output multiple search replace blocks if needed.\\n\\n2. The ORIGINAL code in each SEARCH/REPLACE block must EXACTLY match lines in the original file. Do not add or remove any whitespace or comments from the original code.\\n\\n3. Each ORIGINAL text must be large enough to uniquely identify the change. However, bias towards writing as little as possible.\\n\\n4. Each ORIGINAL text must be DISJOINT from all other ORIGINAL text.\\n\\n5. This field is a STRING (not an array).\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"A string of SEARCH/REPLACE block(s) which will be applied to the given file.\\nYour SEARCH/REPLACE blocks string must be formatted as follows:\\n<<<<<<< ORIGINAL\\n// ... original code goes here\\n=======\\n// ... final code goes here\\n>>>>>>> UPDATED\\n\\n<<<<<<< ORIGINAL\\n// ... original code goes here\\n=======\\n// ... final code goes here\\n>>>>>>> UPDATED\\n\\n## Guidelines:\\n\\n1. You may output multiple search replace blocks if needed.\\n\\n2. The ORIGINAL code in each SEARCH/REPLACE block must EXACTLY match lines in the original file. Do not add or remove any whitespace or comments from the original code.\\n\\n3. Each ORIGINAL text must be large enough to uniquely identify the change. However, bias towards writing as little as possible.\\n\\n4. Each ORIGINAL text must be DISJOINT from all other ORIGINAL text.\\n\\n5. This field is a STRING (not an array).\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The new contents of the file. Must be a string.\"}\nUnrecognized schema: {\"description\":\"The FULL path to the file.\"}\nUnrecognized schema: {\"description\":\"The new contents of the file. Must be a string.\"}\nUnrecognized schema: {\"description\":\"The terminal command to run.\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"The terminal command to run.\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"Natural language description of the command to run (e.g., \\\"list git branches\\\", \\\"run npm tests\\\", \\\"check current directory\\\").\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"Natural language description of the command to run (e.g., \\\"list git branches\\\", \\\"run npm tests\\\", \\\"check current directory\\\").\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"The terminal command to run.\"}\nUnrecognized schema: {\"description\":\"The ID of the terminal created using open_persistent_terminal.\"}\nUnrecognized schema: {\"description\":\"The terminal command to run.\"}\nUnrecognized schema: {\"description\":\"The ID of the terminal created using open_persistent_terminal.\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"Optional. The directory in which to run the command. Defaults to the first workspace folder.\"}\nUnrecognized schema: {\"description\":\"The ID of the persistent terminal.\"}\nUnrecognized schema: {\"description\":\"The ID of the persistent terminal.\"}\nUnrecognized schema: {\"description\":\"The search query string.\"}\nUnrecognized schema: {\"description\":\"Optional. Number of results to return (default is 5). Maximum is 10.\"}\nUnrecognized schema: {\"description\":\"Optional. If true, bypasses cache and fetches fresh results. Default is false.\"}\nUnrecognized schema: {\"description\":\"The search query string.\"}\nUnrecognized schema: {\"description\":\"Optional. Number of results to return (default is 5). Maximum is 10.\"}\nUnrecognized schema: {\"description\":\"Optional. If true, bypasses cache and fetches fresh results. Default is false.\"}\nUnrecognized schema: {\"description\":\"The full URL (including http:// or https://) to fetch and extract content from.\"}\nUnrecognized schema: {\"description\":\"Optional. If true, bypasses cache and fetches fresh content. Default is false.\"}\nUnrecognized schema: {\"description\":\"The full URL (including http:// or https://) to fetch and extract content from.\"}\nUnrecognized schema: {\"description\":\"Optional. If true, bypasses cache and fetches fresh content. Default is false.\"}","type":"server_error"}}"

Notice:
There may be some omissions in the promt, since I changed the source code a little, but I think the meaning of my problem is clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions