You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/components/BuiltinTools.mdx
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,8 @@ import { LinkCard } from '@astrojs/starlight/components';
41
41
<LinkCardtitle="python_code_interpreter_run"description="Executes python 3.12 code for Data Analysis tasks in a docker container. The process output is returned. Do not generate visualizations. The only packages available are numpy===2.1.3, pandas===2.2.3, scipy===1.14.1, matplotlib===3.9.2. There is NO network connectivity. Do not attempt to install other packages or make web requests. You must copy all the necessary files or pass all the data because the python code runs in a separate container."href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
42
42
<LinkCardtitle="python_code_interpreter_copy_files_to_container"description="Copy files from the workspace file system to the container file system. NO absolute paths. Returns the path of each file copied in the python container."href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
43
43
<LinkCardtitle="python_code_interpreter_read_file"description="Reads a file from the container file system. No absolute paths."href="/genaiscript/reference/scripts/system#systempython_code_interpreter" />
44
+
<LinkCardtitle="resource_list"description="List available resources from the host. Returns a list of available resource URIs and their descriptions."href="/genaiscript/reference/scripts/system#systemresources" />
45
+
<LinkCardtitle="resource_read"description="Read the content of a resource from a URL. Resolves various protocols and returns the content of the files found at the URL."href="/genaiscript/reference/scripts/system#systemresources" />
44
46
<LinkCardtitle="retrieval_fuzz_search"description="Search for keywords using the full text of files and a fuzzy distance."href="/genaiscript/reference/scripts/system#systemretrieval_fuzz_search" />
45
47
<LinkCardtitle="retrieval_vector_search"description="Search files using embeddings and similarity distance."href="/genaiscript/reference/scripts/system#systemretrieval_vector_search" />
46
48
<LinkCardtitle="retrieval_web_search"description="Search the web for a user query using Tavily or Bing Search."href="/genaiscript/reference/scripts/system#systemretrieval_web_search" />
GenAIScript provides built-in tools for working with resources through the `system.resources` system script. These tools make it easy to list and read resources in your scripts:
157
+
158
+
### `resource_list`
159
+
160
+
Lists all available resources from the host, returning their URIs and descriptions.
161
+
162
+
```js
163
+
script({
164
+
system: ["system.resources"]
165
+
})
166
+
167
+
$`Use the resource_list tool to see what resources are available, then read one of them.`
168
+
```
169
+
170
+
### `resource_read`
171
+
172
+
Reads content from a URL using the same resolution logic as `host.resolveResource`. Supports all the URL patterns mentioned above.
173
+
174
+
```js
175
+
script({
176
+
system: ["system.resources"]
177
+
})
178
+
179
+
$`Use the resource_read tool to read the content from https://raw.githubusercontent.com/microsoft/genaiscript/main/README.md`
180
+
```
181
+
182
+
The tool automatically handles content formatting, binary detection, and multiple files.
183
+
154
184
## Next steps
155
185
156
186
Are you ready to build your own MCP tools and resources?
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/scripts/system.mdx
+136Lines changed: 136 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3971,6 +3971,142 @@ export default function (ctx: ChatGenerationContext) {
3971
3971
`````
3972
3972
3973
3973
3974
+
### `system.resources`
3975
+
3976
+
Read resource content from a URL using MCP resource resolution
3977
+
3978
+
Provides a tool that can read and return the content of resources from URLs using the host's resolveResource function. Supports various protocols including https, file, git, gist, and vscode.
3979
+
3980
+
- tool `resource_list`: List available resources from the host. Returns a list of available resource URIs and their descriptions.
3981
+
- tool `resource_read`: Read the content of a resource from a URL. Resolves various protocols and returns the content of the files found at the URL.
3982
+
3983
+
`````js wrap title="system.resources"
3984
+
system({
3985
+
title:"Read resource content from a URL using MCP resource resolution",
3986
+
description:
3987
+
"Provides a tool that can read and return the content of resources from URLs using the host's resolveResource function. Supports various protocols including https, file, git, gist, and vscode.",
title: "Read resource content from a URL using MCP resource resolution",
3
+
description:
4
+
"Provides a tool that can read and return the content of resources from URLs using the host's resolveResource function. Supports various protocols including https, file, git, gist, and vscode.",
0 commit comments