list_knowledge_base_documents
Retrieve and filter documents from your organization's security knowledge base by collection, file type, or processing status.
Instructions
List documents in your organization's knowledge base with optional filtering by collections, file type, or status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of documents to return. Default: 100 | |
| offset | No | Number of documents to skip for pagination. Default: 0 | |
| filters | No | Filter documents by collections, file_type (pdf, markdown, plaintext, csv), or status (ready, processing, error) (e.g., 'collections:vuln;security,file_type:pdf,status:ready'). Multiple filters can be combined with commas. |
Implementation Reference
- src/operations/knowledge-base.ts:98-127 (handler)Core handler function that makes the API request to list knowledge base documents using the RadSecurityClient.export async function listDocuments( client: RadSecurityClient, limit?: number, offset?: number, filters?: string, ): Promise<any> { const tenantId = await client.getTenantId(); const params: Record<string, any> = {}; if (limit !== undefined) { params.limit = limit; } if (offset !== undefined) { params.offset = offset; } if (filters !== undefined) { params.filters = filters; } return client.makeRequest( `/tenants/${tenantId}/accounts/${client.getAccountId()}/knowledge_base/documents`, params, { method: "GET", } ); }
- Zod schema defining the input parameters for the list_knowledge_base_documents tool.export const ListDocumentsSchema = z.object({ limit: z.number().optional().describe("Maximum number of documents to return. Default: 100"), offset: z.number().optional().describe("Number of documents to skip for pagination. Default: 0"), filters: z.string().optional().describe("Filter documents by collections, file_type (pdf, markdown, plaintext, csv), or status (ready, processing, error) (e.g., 'collections:vuln;security,file_type:pdf,status:ready'). Multiple filters can be combined with commas."), });
- src/index.ts:563-567 (registration)Tool registration in the ListTools response, specifying name, description, and input schema.name: "list_knowledge_base_documents", description: "List documents in your organization's knowledge base with optional filtering by collections, file type, or status", inputSchema: zodToJsonSchema(knowledgeBase.ListDocumentsSchema), },
- src/index.ts:1503-1517 (handler)MCP CallTool dispatch handler that validates input with the schema, invokes the listDocuments function, and returns the JSON response as text content.case "list_knowledge_base_documents": { const args = knowledgeBase.ListDocumentsSchema.parse( request.params.arguments ); const response = await knowledgeBase.listDocuments( client, args.limit, args.offset, args.filters ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], };