External Access, Search, and Annotation Functions

These functions let CodeBot run approved external actions, inspect folders and web pages, recheck MCP endpoints, open URLs for the user, search project files, and show review annotations.

Terminal, Folders, URLs, and MCP

  • executeTerminalCommand runs an arbitrary terminal command in the current solution folder and returns stdout and stderr. It requires approval. An optional commandPrefix lets the user approve a reusable command prefix.
  • listContentsOfFolder lists the direct contents of an absolute local folder path. It is useful for explicit folder requests or paths outside the solution model.
  • getTextContentOfUrl fetches text content from an http or https URL. The user can approve the exact URL, the website, or broader web access.
  • recheckMcps reconnects configured MCP endpoints and reports which MCP tools, resources, and prompts are available. It does not edit MCP configuration.
  • openUrlForUser opens an approved URL for the user in the browser or associated local app. It is for showing or launching a URL, not reading its contents.

Prefer host or solution-specific discovery tools before using generic terminal or folder functions. Use getTextContentOfUrl when CodeBot needs to inspect a page; use openUrlForUser only when the user wants the URL opened.

  • performSearchAndGetResults searches for a string in the current solution or workspace and returns matching file paths. It accepts search options for case sensitivity, whole-word matching, regular-expression mode, and result mode.

Use this for shared CodeBot search behavior when a host-specific richer search surface is not available.

Diff Annotations

  • showDiff shows a diff annotation in the chat from old and new text. It does not modify files. It can include a filePath, summary, and labels for the old and new sides.

Use showDiff when the user should review a proposed change or compare generated content before another action writes it.

Diagnostic Helpers

CodeBot also has small diagnostic/test helper functions:

  • takeLong simulates a long-running tool with progress.
  • askForApproval exercises the approval flow.
  • addAnnotation exercises annotation display.
  • askMeQuestions exercises question/answer UI behavior.

These are useful for development and testing. They should not be treated as normal user-facing workflow tools.

When To Use Which Tool

Use executeTerminalCommand only when the action really needs the shell.

Use listContentsOfFolder for direct folder inspection outside the solution model.

Use getTextContentOfUrl to read web text and openUrlForUser to open a URL for the user.

Use recheckMcps when a configured MCP-backed capability appears unavailable.

Use performSearchAndGetResults for text search over known project/workspace files.

Use showDiff for review-only comparisons.