Windsurf Agent 模式深度解读(二)!只要LLM撑得住,Tool有的是

前言

之前我们在第一篇 Windsurf Agent 模式深度解读(一)!比Cursor的方案更有未来?里面介绍了Windsurf Agent模式的System Prompt设计,了解到了它是采用LLM直出的Agent方案,本篇就来介绍System Prompt里面Tool描述的部分,当前版本(25年5月)总共包含19个Tool(后续的版本肯定会越来越多),主要分为五大类,不多废话,直接进入主题解读。

Deploy Tools

browser_preview

为 Web 服务器启动浏览器预览。

这允许用户正常与 Web 服务器交互,并将 Web 服务器的控制台日志和其他信息提供给 Cascade。请注意,此工具调用不会自动为用户打开浏览器预览,用户必须点击提供的按钮之一才能在浏览器中打开它。

browser_preview:<browser_preview>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Url": {
            "type": "string",
            "description": "The URL of the target web server to provide a browser preview for. This should contain the scheme (e.g. http:// or https://), domain (e.g. localhost or 127.0.0.1), and port (e.g. :8080) but no path."
        },
        "Name": {
            "type": "string",
            "description": "A short name 3-5 word name for the target web server. Should be title-cased e.g. 'Personal Website'. Format as a simple string, not as markdown; and please output the title directly, do not prefix it with 'Title:' or anything similar."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Url",
        "Name"
    ]
}
<browser_preview>
Description: Spin up a browser preview for a web server. This allows the USER to interact with the web server normally as well as provide console logs and other information from the web server to Cascade. Note that this tool call will not automatically open the browser preview for the USER, they must click one of the provided buttons to open it in the browser.

check_deploy_status

使用 web 应用程序的 windsurf_deployment_id 检查部署状态,并确定应用程序构建是否成功以及是否已被认领。除非用户要求,否则请勿运行此命令。此命令必须在 deploy_web_app 工具调用后运行。

check_deploy_status:<check_deploy_status>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "WindsurfDeploymentId": {
            "type": "string",
            "description": "The Windsurf deployment ID for the deploy we want to check status for. This is NOT a project_id."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "WindsurfDeploymentId"
    ]
}
</check_deploy_status>
Description: Check the status of the deployment using its windsurf_deployment_id for a web application and determine if the application build has succeeded and whether it has been claimed. Do not run this unless asked by the user. It must only be run after a deploy_web_app tool call.

deploy_web_app

将 JavaScript Web 应用程序部署到 Netlify 等部署提供商。

无需构建站点,只需提供源文件。请确保先运行 read_deployment_config 工具,并在尝试部署之前创建所有缺失的文件。如果要部署到现有站点,请使用 project_id 来标识站点。如果要部署新站点,请将 project_id 留空。

deploy_web_app:<deploy_web_app>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Framework": {
            "type": "string",
            "enum": [
                "eleventy",
                "angular",
                "astro",
                "create-react-app",
                "gatsby",
                "gridsome",
                "grunt",
                "hexo",
                "hugo",
                "hydrogen",
                "jekyll",
                "middleman",
                "mkdocs",
                "nextjs",
                "nuxtjs",
                "remix",
                "sveltekit",
                "svelte"
            ],
            "description": "The framework of the web application."
        },
        "ProjectPath": {
            "type": "string",
            "description": "The full absolute project path of the web application."
        },
        "Subdomain": {
            "type": "string",
            "description": "Subdomain or project name used in the URL. Leave this EMPTY if you are deploying to an existing site using the project_id. For a new site, the subdomain should be unique and relevant to the project."
        },
        "ProjectId": {
            "type": "string",
            "description": "The project ID of the web application if it exists in the deployment configuration file. Leave this EMPTY for new sites or if the user would like to rename a site. If this is a re-deploy, look for the project ID in the deployment configuration file and use that exact same ID."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Framework",
        "ProjectPath",
        "Subdomain",
        "ProjectId"
    ]
}
</deploy_web_app>
Description: Deploy a JavaScript web application to a deployment provider like Netlify. Site does not need to be built. Only the source files are required. Make sure to run the read_deployment_config tool first and that all missing files are created before attempting to deploy. If you are deploying to an existing site, use the project_id to identify the site. If you are deploying a new site, leave the project_id empty.

read_deployment_config

读取 Web 应用的部署配置,并确定该应用是否已准备好部署。仅应用于 deploy_web_app 工具的准备工作。

read_deployment_config:<read_deployment_config>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "ProjectPath": {
            "type": "string",
            "description": "The full absolute project path of the web application."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "ProjectPath"
    ]
}
</read_deployment_config>
Description: Read the deployment configuration for a web application and determine if the application is ready to be deployed. Should only be used in preparation for the deploy_web_app tool.

Search Tools

codebase_search

从代码库中查找与搜索查询最相关的代码片段。

当搜索查询更精确且与代码的功能或用途相关时,此方法效果最佳。如果提出非常宽泛的问题,例如询问大型组件或系统的通用“框架”或“实现”,结果会很差。仅显示排名靠前的项目的完整代码内容,并且可能被截断。对于其他项目,仅显示文档字符串和签名。使用 view_code_item 并使用相同的路径和节点名称来查看任何项目的完整代码内容。请注意,如果您尝试搜索超过 500 个文件,搜索结果的质量会显著下降。请仅在确实有必要时才尝试搜索大量文件。

codebase_search:<codebase_search>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Query": {
            "type": "string",
            "description": "Search query"
        },
        "TargetDirectories": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "List of absolute paths to directories to search over"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Query",
        "TargetDirectories"
    ]
}
</codebase_search>
Description: Find snippets of code from the codebase most relevant to the search query. This performs best when the search query is more precise and relating to the function or purpose of code. Results will be poor if asking a very broad question, such as asking about the general 'framework' or 'implementation' of a large component or system. Will only show the full code contents of the top items, and they may also be truncated. For other items it will only show the docstring and signature. Use view_code_item with the same path and node name to view the full code contents for any item. Note that if you try to search over more than 500 files, the quality of the search results will be substantially worse. Try to only search over a large number of files if it is really necessary.

grep_serch

使用 ripgrep 在文件或目录中查找精确的模式匹配。结果以 JSON 格式返回,对于每个匹配项,您将收到以下信息:

  • 文件名

  • 行号

  • 行内容:匹配行的内容。总结果上限为 50 条。使用“包含”选项按文件类型或特定路径进行筛选,以优化搜索。

grep_serch:<grep_serch>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "SearchPath": {
            "type": "string",
            "description": "The path to search. This can be a directory or a file. This is a required parameter."
        },
        "Query": {
            "type": "string",
            "description": "The search term or pattern to look for within files."
        },
        "MatchPerLine": {
            "type": "boolean",
            "description": "If true, returns each line that matches the query, including line numbers and snippets of matching lines (equivalent to 'git grep -nI'). If false, only returns the names of files containing the query (equivalent to 'git grep -l')."
        },
        "Includes": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "The files or directories to search within. Supports file patterns (e.g., '*.txt' for all .txt files) or specific paths (e.g., 'path/to/file.txt' or 'path/to/dir'). Leave this empty if you're grepping within an individual file."
        },
        "CaseInsensitive": {
            "type": "boolean",
            "description": "If true, performs a case-insensitive search."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "SearchPath",
        "Query",
        "MatchPerLine",
        "Includes",
        "CaseInsensitive"
    ]
}
</grep_serch>
Description: Use ripgrep to find exact pattern matches within files or directories. Results are returned in JSON format and for each match you will receive the:
Filename
LineNumber
LineContent: the content of the matching line Total results are capped at 50 matches. Use the Includes option to filter by file type or specific paths to refine your search.

search_web

执行网络搜索以获取给定查询和可选域过滤器的相关网络文档列表。

search_web:<search_web>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "query": {
            "type": "string"
        },
        "domain": {
            "type": "string",
            "description": "Optional domain to recommend the search prioritize"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "query",
        "domain"
    ]
}
</search_web>
Description: Performs a web search to get a list of relevant web documents for the given query and optional domain filter.

File Processing Tools

edit_file

请勿对同一文件进行并行编辑。使用此工具编辑现有文件。请遵循以下规则:

  • 仅指定您要编辑的精确代码行。

  • 切勿指定或写出未更改的代码。相反,请使用此特殊占位符 {{ ... }} 表示所有未更改的代码。

  • 要编辑同一文件中多行不相邻的代码,请一次调用此工具。使用特殊占位符 {{ ... }} 按顺序指定每个编辑,以在已编辑行之间表示未更改的代码。以下是如何同时编辑三行不相邻代码的示例:代码内容:{{ ... }}\nedited_line_1\n{{ ... }}\nedited_line_2\n{{ ... }}\nedited_line_3\n{{ ... }}

  • 您不能编辑文件扩展名:[.ipynb]。您应该在其他参数之前指定以下参数:[TargetFile]

edit_file:<edit_file>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "CodeMarkdownLanguage": {
            "type": "string",
            "description": "Markdown language for the code block, e.g 'python' or 'javascript'"
        },
        "TargetFile": {
            "type": "string",
            "description": "The target file to modify. Always specify the target file as the very first argument."
        },
        "Instruction": {
            "type": "string",
            "description": "A description of the changes that you are making to the file."
        },
        "TargetLintErrorIds": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "If applicable, IDs of lint errors this edit aims to fix (they'll have been given in recent IDE feedback). If you believe the edit could fix lints, do specify lint IDs; if the edit is wholly unrelated, do not. A rule of thumb is, if your edit was influenced by lint feedback, include lint IDs. Exercise honest judgement here."
        },
        "CodeEdit": {
            "type": "string",
            "description": "Specify ONLY the precise lines of code that you wish to edit. NEVER specify or write out unchanged code. Instead, represent all unchanged code using this special placeholder: {{ ... }}"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "CodeMarkdownLanguage",
        "TargetFile",
        "Instruction",
        "TargetLintErrorIds",
        "CodeEdit"
    ]
}
</edit_file>
Description: Do NOT make parallel edits to the same file.\nUse this tool to edit an existing file. Follow these rules:\n1. Specify ONLY the precise lines of code that you wish to edit.\n2. **NEVER specify or write out unchanged code**. Instead, represent all unchanged code using this special placeholder: {{ ... }}.\n3. To edit multiple, non-adjacent lines of code in the same file, make a single call to this tool. Specify each edit in sequence with the special placeholder {{ ... }} to represent unchanged code in between edited lines.\nHere's an example of how to edit three non-adjacent lines of code at once:\nCodeContent:\n{{ ... }}\nedited_line_1\n{{ ... }}\nedited_line_2\n{{ ... }}\nedited_line_3\n{{ ... }}\n\n5. You may not edit file extensions: [.ipynb]\nYou should specify the following arguments before the others: [TargetFile]

find_by_name

使用 fd 在指定目录中搜索文件和子目录。

搜索功能使用智能大小写,并默认忽略已忽略的 gitignored 文件。“模式”和“排除”均使用 glob 格式。如果您要搜索“扩展名”,则无需同时指定“模式”和“扩展名”。为避免输出过多,搜索结果上限为 50 条。您可以使用各种参数根据需要筛选搜索范围。结果将包含类型、大小、修改时间和相对路径。

find_by_name:<find_by_name>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "SearchDirectory": {
            "type": "string",
            "description": "The directory to search within"
        },
        "Pattern": {
            "type": "string",
            "description": "Optional, Pattern to search for, supports glob format"
        },
        "Excludes": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "Optional, exclude files/directories that match the given glob patterns"
        },
        "Type": {
            "type": "string",
            "description": "Optional, type filter, enum=file,directory,any"
        },
        "MaxDepth": {
            "type": "integer",
            "description": "Optional, maximum depth to search"
        },
        "Extensions": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "Optional, file extensions to include (without leading .), matching paths must match at least one of the included extensions"
        },
        "FullPath": {
            "type": "boolean",
            "description": "Optional, whether the full absolute path must match the glob pattern, default: only filename needs to match. Take care when specifying glob patterns with this flag on, e.g when FullPath is on, pattern '.py' will not match to the file '/foo/bar.py', but pattern '**/.py' will match."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "SearchDirectory",
        "Pattern",
        "Excludes",
        "Type",
        "MaxDepth",
        "Extensions",
        "FullPath"
    ]
}
</find_by_name>
Description: Search for files and subdirectories within a specified directory using fd. Search uses smart case and will ignore gitignored files by default. Pattern and Excludes both use the glob format. If you are searching for Extensions, there is no need to specify both Pattern AND Extensions. To avoid overwhelming output, the results are capped at 50 matches. Use the various arguments to filter the search scope as needed. Results will include the type, size, modification time, and relative path.

list_dir

列出目录的内容。

目录路径必须是指向已存在目录的绝对路径。对于目录中的每个子目录,输出将包含:目录的相对路径、目录还是文件、文件大小(以字节为单位)以及目录的子目录数量(递归)。

list_dir:<list_dir>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "DirectoryPath": {
            "type": "string",
            "description": "Path to list contents of, should be absolute path to a directory"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "DirectoryPath"
    ]
}
</list_dir>
Description: List the contents of a directory. Directory path must be an absolute path to a directory that exists. For each child in the directory, output will have: relative path to the directory, whether it is a directory or file, size in bytes if file, and number of children (recursive) if directory.

view_code_item

查看代码项节点的内容,例如文件中的类或函数。

您必须使用完全限定的代码项名称,例如 grep_search 工具返回的名称。例如,如果您有一个名为 Foo 的类,并且想要查看 Foo 类中的函数定义 bar,则可以使用 Foo.bar 作为 NodeName。如果 codebase_search 工具之前已经显示过该符号的内容,则不要请求查看该符号。如果在文件中未找到该符号,该工具将返回空字符串。

view_code_item:<view_code_item>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "File": {
            "type": "string",
            "description": "Absolute path to the node to edit, e.g /path/to/file"
        },
        "NodePath": {
            "type": "string",
            "description": "Path of the node within the file, e.g package.class.FunctionName"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "NodePath"
    ]
}
</view_code_item>
Description: View the content of a code item node, such as a class or a function in a file. You must use a fully qualified code item name, such as those return by the grep_search tool. For example, if you have a class called Foo and you want to view the function definition bar in the Foo class, you would use Foo.bar as the NodeName. Do not request to view a symbol if the contents have been previously shown by the codebase_search tool. If the symbol is not found in a file, the tool will return an empty string instead.

view_file

查看文件内容。

文件的行索引从 0 开始,此工具调用的输出将是文件从 StartLine 到 EndLine(含)的内容,以及 StartLine 和 EndLine 之外的行的摘要。请注意,此调用一次最多可以查看 200 行。

使用此工具收集信息时,您有责任确保拥有完整的上下文。具体来说,每次调用此命令时,您应该:

  • 评估您查看的文件内容是否足以继续执行您的任务。

  • 如果您查看的文件内容不足,并且您怀疑它们可能存在于未显示的行中,请主动再次调用此工具以查看这些行。

如有疑问,请再次调用此工具以收集更多信息。请记住,部分文件视图可能会错过关键的依赖项、导入或功能。

view_file:<view_file>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "AbsolutePath": {
            "type": "string",
            "description": "Path to file to view. Must be an absolute path."
        },
        "StartLine": {
            "type": "integer",
            "description": "Startline to view"
        },
        "EndLine": {
            "type": "integer",
            "description": "Endline to view, inclusive. This cannot be more than 200 lines away from StartLine"
        },
        "IncludeSummaryOfOtherLines": {
            "type": "boolean",
            "description": "If true, you will also get a condensed summary of the full file contents in addition to the exact lines of code from StartLine to EndLine."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "AbsolutePath",
        "StartLine",
        "EndLine",
        "IncludeSummaryOfOtherLines"
    ]
}
</view_file>
Description: View the contents of a file. The lines of the file are 0-indexed, and the output of this tool call will be the file contents from StartLine to EndLine (inclusive), together with a summary of the lines outside of StartLine and EndLine. Note that this call can view at most 200 lines at a time.
When using this tool to gather information, it's your responsibility to ensure you have the COMPLETE context. Specifically, each time you call this command you should:

Assess if the file contents you viewed are sufficient to proceed with your task.
If the file contents you have viewed are insufficient, and you suspect they may be in lines not shown, proactively call the tool again to view those lines.
When in doubt, call this tool again to gather more information. Remember that partial file views may miss critical dependencies, imports, or functionality.

view_web_document_content_chunk

view_web_document_content_chunk:<view_web_document_content_chunk>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "url": {
            "type": "string",
            "description": "The URL that the chunk belongs to"
        },
        "position": {
            "type": "integer",
            "description": "The position of the chunk to view"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "url",
        "position"
    ]
}
</view_web_document_content_chunk>
Description: View a specific chunk of web document content using its URL and chunk position. The URL must have already been read by the read_url_content tool before this can be used on that particular URL.

write_to_file

使用此工具创建新文件。

如果文件及其父目录尚不存在,系统将自动创建。请遵循以下说明:1. 切勿使用此工具修改或覆盖现有文件。调用此工具前,请务必确认 TargetFile 不存在。2. 必须将 TargetFile 指定为第一个参数。请在任何代码内容之前指定完整的 TargetFile。您应该在其他参数之前指定以下参数:[TargetFile]

write_to_file:<write_to_file>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "TargetFile": {
            "type": "string",
            "description": "The target file to create and write code to."
        },
        "CodeContent": {
            "type": "string",
            "description": "The code contents to write to the file."
        },
        "EmptyFile": {
            "type": "boolean",
            "description": "Set this to true to create an empty file."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "TargetFile",
        "CodeContent",
        "EmptyFile"
    ]
}
</write_to_file>
Description: Use this tool to create new files. The file and any parent directories will be created for you if they do not already exist. Follow these instructions: 1. NEVER use this tool to modify or overwrite existing files. Always first confirm that TargetFile does not exist before calling this tool. 2. You MUST specify TargetFile as the FIRST argument. Please specify the full TargetFile before any of the code contents.

Bash/Shell Tools

run_command

建议代表用户运行命令。

操作系统:windows。Shell:powershell。切勿建议 cd 命令。如果您有此工具,请注意您确实能够直接在用户系统上运行命令。请确保将命令行指定为与在 Shell 中运行的命令完全相同。请注意,用户必须在执行命令之前批准该命令。如果用户不喜欢,可以拒绝它。实际命令在用户批准之前不会执行。用户可能不会立即批准。如果该步骤正在等待用户批准,则表示它尚未开始运行。命令将使用 PAGER=cat 运行。您可能需要限制通常依赖分页且可能包含非常长输出的命令的输出长度(例如 git log,使用 git log -n )。

run_command:<run_command>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "CommandLine": {
            "type": "string",
            "description": "The exact command line string to execute."
        },
        "Cwd": {
            "type": "string",
            "description": "The current working directory for the command"
        },
        "Blocking": {
            "type": "boolean",
            "description": "If true, the command will block until it is entirely finished. During this time, the user will not be able to interact with Cascade. Blocking should only be true if (1) the command will terminate in a relatively short amount of time, or (2) it is important for you to see the output of the command before responding to the USER. Otherwise, if you are running a long-running process, such as starting a web server, please make this non-blocking."
        },
        "WaitMsBeforeAsync": {
            "type": "integer",
            "description": "Only applicable if Blocking is false. This specifies the amount of milliseconds to wait after starting the command before sending it to be fully async. This is useful if there are commands which should be run async, but may fail quickly with an error. This allows you to see the error if it happens in this duration. Don't set it too long or you may keep everyone waiting."
        },
        "SafeToAutoRun": {
            "type": "boolean",
            "description": "Set to true if you believe that this command is safe to run WITHOUT user approval. A command is unsafe if it may have some destructive side-effects. Example unsafe side-effects include: deleting files, mutating state, installing system dependencies, making external requests, etc. Set to true only if you are extremely confident it is safe. If you feel the command could be unsafe, never set this to true, EVEN if the USER asks you to. It is imperative that you never auto-run a potentially unsafe command."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "CommandLine",
        "Cwd",
        "Blocking",
        "WaitMsBeforeAsync",
        "SafeToAutoRun"
    ]
}
</run_command>
Description: PROPOSE a command to run on behalf of the user. Operating System: windows. Shell: powershell. NEVER PROPOSE A cd COMMAND. If you have this tool, note that you DO have the ability to run commands directly on the USER's system. Make sure to specify CommandLine exactly as it should be run in the shell. Note that the user will have to approve the command before it is executed. The user may reject it if it is not to their liking. The actual command will NOT execute until the user approves it. The user may not approve it immediately. If the step is WAITING for user approval, it has NOT started running. Commands will be run with PAGER=cat. You may want to limit the length of output for commands that usually rely on paging and may contain very long output (e.g. git log, use git log -n ).

command_status

通过 ID 获取先前执行的终端命令的状态。返回当前状态(正在运行、已完成)、按输出优先级指定的输出行以及任何可能存在的错误。请勿尝试检查除后台命令 ID 之外的任何 ID 的状态。

command_status:<command_status>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "CommandId": {
            "type": "string",
            "description": "ID of the command to get status for"
        },
        "OutputPriority": {
            "type": "string",
            "enum": [
                "top",
                "bottom",
                "split"
            ],
            "description": "Priority for displaying command output. Must be one of: 'top' (show oldest lines), 'bottom' (show newest lines), or 'split' (prioritize oldest and newest lines, excluding middle)"
        },
        "OutputCharacterCount": {
            "type": "integer",
            "description": "Number of characters to view. Make this as small as possible to avoid excessive memory usage."
        },
        "WaitDurationSeconds": {
            "type": "integer",
            "description": "Number of seconds to wait for command completion before getting the status. If the command completes before this duration, this tool call will return early. Set to 0 to get the status of the command immediately. If you are only interested in waiting for command completion, set to 60."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "CommandId",
        "OutputPriority",
        "OutputCharacterCount",
        "WaitDurationSeconds"
    ]
}
</command_status>
Description: Get the status of a previously executed terminal command by its ID. Returns the current status (running, done), output lines as specified by output priority, and any error if present. Do not try to check the status of any IDs other than Background command IDs.

Other Tools

read_url_content

从 URL 读取内容。

URL 必须是 HTTP 或 HTTPS URL,且指向可通过 Web 浏览器访问的有效互联网资源。

read_url_content:<read_url_content>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Url": {
            "type": "string",
            "description": "URL to read content from"
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Url"
    ]
}
</read_url_content>
Description: Read content from a URL. URL must be an HTTP or HTTPS URL that points to a valid internet resource accessible via web browser.

create_memmory

描述:将与用户及其任务相关的重要上下文保存到记忆数据库中。要保存的上下文示例:

  • 用户偏好

  • 用户明确要求记住某些内容或以其他方式改变您的行为

  • 重要代码片段

  • 技术栈

  • 项目结构

  • 主要里程碑或功能

  • 新的设计模式和架构决策

  • 任何其他您认为需要记住的重要信息。在创建新记忆之前,请先检查数据库中是否已存在语义相关的记忆。如果找到,请更新它,而不是创建重复的记忆。必要时,使用此工具删除不正确的记忆。

create_memmory:<create_memmory>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Id": {
            "type": "string",
            "description": "Id of an existing MEMORY to update or delete. When creating a new MEMORY, leave this blank."
        },
        "Title": {
            "type": "string",
            "description": "Descriptive title for a new or updated MEMORY. This is required when creating or updating a memory. When deleting an existing MEMORY, leave this blank."
        },
        "Content": {
            "type": "string",
            "description": "Content of a new or updated MEMORY. When deleting an existing MEMORY, leave this blank."
        },
        "CorpusNames": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "CorpusNames of the workspaces associated with the MEMORY. Each element must be a FULL AND EXACT string match, including all symbols, with one of the CorpusNames provided in your system prompt. Only used when creating a new MEMORY."
        },
        "Tags": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "Tags to associate with the MEMORY. These will be used to filter or retrieve the MEMORY. Only used when creating a new MEMORY. Use snake_case."
        },
        "Action": {
            "type": "string",
            "enum": [
                "create",
                "update",
                "delete"
            ],
            "description": "The type of action to take on the MEMORY. Must be one of 'create', 'update', or 'delete'"
        },
        "UserTriggered": {
            "type": "boolean",
            "description": "Set to true if the user explicitly asked you to create/modify this memory."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Id",
        "Title",
        "Content",
        "CorpusNames",
        "Tags",
        "Action",
        "UserTriggered"
    ]
}
</create_memmory>
Description: Save important context relevant to the USER and their task to a memory database. Examples of context to save:
USER preferences
Explicit USER requests to remember something or otherwise alter your behavior
Important code snippets
Technical stacks
Project structure
Major milestones or features
New design patterns and architectural decisions
Any other information that you think is important to remember. Before creating a new memory, first check to see if a semantically related memory already exists in the database. If found, update it instead of creating a duplicate. Use this tool to delete incorrect memories when necessary.

suggested_response

如果您没有调用其他工具,而是向用户提问,请使用此工具提供少量可能的建议答案。

例如,可以是“是/否”,或其他简单的多项选择题。请谨慎使用此功能,并且仅当您确信用户会提供其中一个建议选项时才使用。如果用户的下一个输入可能是包含更多详细信息的简短或完整回复,则不要提供任何建议。例如,假设用户接受了您的建议答案:如果您随后又提出另一个后续问题,那么这个建议就是错误的,您一开始就不应该这样做。尽量不要连续多次使用此功能。

suggested_response:<suggested_response>
{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "properties": {
        "Suggestions": {
            "items": {
                "type": "string"
            },
            "type": "array",
            "description": "List of suggestions. Each should be at most a couple words, do not return more than 3 options."
        }
    },
    "additionalProperties": false,
    "type": "object",
    "required": [
        "Suggestions"
    ]
}
</suggested_response>
Description: If you are calling no other tools and are asking a question to the user, use this tool to supply a small number of possible suggested answers to your question. Examples can be Yes/No, or other simple multiple choice options. Use this sparingly and only if you are confidently expecting to receive one of the suggested options from the user. If the next user input might be a short or long form response with more details, then do not make any suggestions. For example, pretend the user accepted your suggested response: if you would then ask another follow-up question, then the suggestion is bad and you should not have made it in the first place. Try not to use this many times in a row.

总结

其实可以看到,Windsurf的Tool描述,跟目前广泛使用的Function Call Tool 描述并没有本质的区别,都是集tool的parameters以及description信息于一身让LLM理解其作用。但Windsurf为了让LLM更好的去使用Tool,还会给出few shots让LLM去参考,第一篇里面也说到了这个部分。

附录-AI编程IDE

目前AI Coding的产品中,主要有四大类(个人分类,可能不准,仅供参考):

  • AI IDE:如Cursor、Windsurf、Trae等。

  • AI 插件:如Github Copilot、Codeium、通义灵码、Comate等。

  • AI 问答助手:如Stack Overflow OverflowAI、豆包AI编程等。

  • AI 开发工具:如Claude Code、v0、Devin、Lovable、Replit等。

关于AI IDE这里,基本上都是基于VSCode进行开发的,可以观察下目前Cursor、Windsurf和Trae的主界面,跟VSCode原生界面都是一种风格,Trae的UI更加讨喜一些,毕竟有国内版。

① Cursor

在这里插入图片描述

② Windsurf

在这里插入图片描述

③ Trae

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

依然易冷

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值