/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { documentsList } from "../../funcs/documentsList.js"; import * as operations from "../../models/operations/index.js"; import { formatResult, ToolDefinition } from "../tools.js"; const args = { request: operations.ListDocumentsRequest$inboundSchema.optional(), }; export const tool$documentsList: ToolDefinition = { name: "documents-list", description: `List Documents List all documents sorted by created_at in descending order. Results are paginated with a max limit of 100. When more documents are available, a \`cursor\` will be provided. Use the \`cursor\` parameter to retrieve the subsequent page.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await documentsList( client, args.request, { fetchOptions: { signal: ctx.signal } }, ).$inspect(); if (!result.ok) { return { content: [{ type: "text", text: result.error.message }], isError: true, }; } const value = result.value.result; return formatResult(value, apiCall); }, };