Octri

get_endpoint

返回一个端点的完整文档。包含已发布端点页面中的所有内容:描述、参数、请求正文字段、响应和代码示例,并以代理可读取的文本形式呈现。

何时会列出

适用于每台服务器和每种工具模式。工具组可以不包含文档工具。

参数

slugstring必填

端点的 slug,与 search_docs 或 list_endpoints 输出的完全一致。

projectIdstring

要读取的项目。省略此项:服务器已知晓其项目,传入其他项目则会改为读取该项目。

返回值

端点的标题、API 版本和 METHOD /path,然后分别列出参数、请求正文、响应和代码示例;没有的内容会省略。已弃用的端点会先说明这一点。

提示

客户端读取的注释,用于判断哪些操作可以在不询问用户的情况下运行。

提示值为 true 时,表示
readOnlyHinttrue不会更改任何内容
destructiveHintfalse可以更改或删除数据
idempotentHinttrue调用两次不会比调用一次做得更多
openWorldHinttrue会通过网络访问服务器之外的资源

示例

读取一个端点

Call
{
  "name": "get_endpoint",
  "arguments": {
    "slug": "post-customers"
  }
}
Result
# Create a customer
**Version:** 2024-08-01
**Project:** Acme API
`POST /customers`

## Request body (application/json)
- **name** (string) *(required)*
- **email** (string) *(required)*
- **currency** (string)
- **address** (object)
- **metadata** (object)

## Responses
- **201**: The customer that was created.
- **400**: The request was malformed or failed validation.
- **401**: The API key is missing, malformed or revoked.
- **409**: A customer with that email already exists.

## Code Examples
```curl
curl -X POST 'https://api.acme.com/v1/customers' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{"name":"Example Name","email":"user@example.com","currency":"USD","address":{"line1":"example_value","line2":"example_value","city":"example_value","postal_code":"example_value","country":"GB"},"metadata":{}}'
```
…