+ body: "{\"messages\":[{\"content\":\"You are a knowledgeable assistant that helps users with various tasks.\\nBe helpful, accurate, and concise in your responses.\\n\",\"role\":\"system\"},{\"content\":\"## Filesystem Tool Instructions\\n\\nThis toolset provides comprehensive filesystem operations with built-in security restrictions.\\n\\n### Security Model\\n- All operations are restricted to allowed directories only\\n- Use list_allowed_directories to see available paths\\n- Subdirectories within allowed directories are accessible\\n- Use add_allowed_directory to request access to new directories (requires user consent)\\n\\n### Directory Access Management\\n- If you need access to a directory outside the allowed list, use add_allowed_directory\\n- This will request user consent before expanding filesystem access\\n- Always provide a clear reason when requesting new directory access\\n\\n### Common Patterns\\n- Always check if directories exist before creating files\\n- Prefer read_multiple_files for batch operations\\n- Use search_files_content for finding specific code or text\\n\\n### Performance Tips\\n- Use read_multiple_files instead of multiple read_file calls\\n- Use directory_tree with max_depth to limit large traversals\\n- Use appropriate exclude patterns in search operations\",\"role\":\"system\"},{\"content\":\"How many files in testdata/working_dir? Only output the number.\",\"role\":\"user\"},{\"tool_calls\":[{\"id\":\"1IkZdXSvy\",\"function\":{\"arguments\":\"{\\\"path\\\": \\\"testdata/working_dir\\\"}\",\"name\":\"list_directory\"},\"type\":\"function\"}],\"role\":\"assistant\"},{\"content\":\"FILE README.me\\n\",\"tool_call_id\":\"1IkZdXSvy\",\"role\":\"tool\"}],\"model\":\"mistral-small\",\"stream_options\":{\"include_usage\":true},\"tools\":[{\"function\":{\"name\":\"create_directory\",\"description\":\"Create a new directory or ensure a directory exists. Can create multiple nested directories in one operation.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The directory path to create\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"directory_tree\",\"description\":\"Get a recursive tree view of files and directories as a JSON structure.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"max_depth\":{\"description\":\"Maximum depth to traverse (optional)\",\"type\":\"integer\"},\"path\":{\"description\":\"The directory path to traverse\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"edit_file\",\"description\":\"Make line-based edits to a text file. Each edit replaces exact line sequences with new content.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"edits\":{\"description\":\"Array of edit operations\",\"items\":{\"additionalProperties\":false,\"properties\":{\"newText\":{\"description\":\"The replacement text\",\"type\":\"string\"},\"oldText\":{\"description\":\"The exact text to replace\",\"type\":\"string\"}},\"required\":[\"oldText\",\"newText\"],\"type\":\"object\"},\"type\":\"array\"},\"path\":{\"description\":\"The file path to edit\",\"type\":\"string\"}},\"required\":[\"path\",\"edits\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"get_file_info\",\"description\":\"Retrieve detailed metadata about a file or directory.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The file or directory path to inspect\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"list_allowed_directories\",\"description\":\"Returns a list of directories that the server has permission to access. Don't call if you access only the current working directory. It's always allowed.\",\"parameters\":{\"properties\":{},\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"add_allowed_directory\",\"description\":\"Request to add a new directory to the allowed directories list. This requires explicit user consent for security reasons.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The directory path to add to allowed directories\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"list_directory\",\"description\":\"Get a detailed listing of all files and directories in a specified path.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The directory path to list\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"list_directory_with_sizes\",\"description\":\"Get a detailed listing of all files and directories in a specified path, including sizes.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The directory path to list\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"move_file\",\"description\":\"Move or rename files and directories.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"destination\":{\"description\":\"The destination path\",\"type\":\"string\"},\"source\":{\"description\":\"The source path\",\"type\":\"string\"}},\"required\":[\"source\",\"destination\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"read_file\",\"description\":\"Read the complete contents of a file from the file system.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"path\":{\"description\":\"The file path to read\",\"type\":\"string\"}},\"required\":[\"path\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"read_multiple_files\",\"description\":\"Read the contents of multiple files simultaneously.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"json\":{\"description\":\"Whether to return the result as JSON\",\"type\":\"boolean\"},\"paths\":{\"description\":\"Array of file paths to read\",\"items\":{\"type\":\"string\"},\"type\":\"array\"}},\"required\":[\"paths\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"search_files\",\"description\":\"Recursively search for files and directories matching a pattern. Prints the full paths of matching files and the total number of files found.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"excludePatterns\":{\"description\":\"Patterns to exclude from search\",\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"path\":{\"description\":\"The starting directory path\",\"type\":\"string\"},\"pattern\":{\"description\":\"The search pattern\",\"type\":\"string\"}},\"required\":[\"path\",\"pattern\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"search_files_content\",\"description\":\"Searches for text or regex patterns in the content of files matching a GLOB pattern.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"excludePatterns\":{\"description\":\"Patterns to exclude from search\",\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"is_regex\":{\"description\":\"If true, treat query as regex; otherwise literal text\",\"type\":\"boolean\"},\"path\":{\"description\":\"The starting directory path\",\"type\":\"string\"},\"query\":{\"description\":\"The text or regex pattern to search for\",\"type\":\"string\"}},\"required\":[\"path\",\"query\"],\"type\":\"object\"}},\"type\":\"function\"},{\"function\":{\"name\":\"write_file\",\"description\":\"Create a new file or completely overwrite an existing file with new content.\",\"parameters\":{\"additionalProperties\":false,\"properties\":{\"content\":{\"description\":\"The content to write to the file\",\"type\":\"string\"},\"path\":{\"description\":\"The file path to write\",\"type\":\"string\"}},\"required\":[\"path\",\"content\"],\"type\":\"object\"}},\"type\":\"function\"}],\"stream\":true}"
0 commit comments