41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.toolHandler = exports.toolDefinition = void 0;
|
|
exports.toolDefinition = {
|
|
name: 'list_threads',
|
|
description: 'List all conversation threads with filtering and sorting options.',
|
|
inputSchema: {
|
|
type: 'object',
|
|
properties: {
|
|
sortBy: {
|
|
type: 'string',
|
|
enum: ['updatedAt', 'createdAt', 'messageCount'],
|
|
description: 'Field to sort by (default: updatedAt)'
|
|
},
|
|
order: {
|
|
type: 'string',
|
|
enum: ['asc', 'desc'],
|
|
description: 'Sort order (default: desc)'
|
|
},
|
|
tags: {
|
|
type: 'array',
|
|
items: { type: 'string' },
|
|
description: 'Filter threads by tags'
|
|
},
|
|
limit: {
|
|
type: 'number',
|
|
description: 'Maximum number of threads to return (default: 50)'
|
|
},
|
|
offset: {
|
|
type: 'number',
|
|
description: 'Pagination offset'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
const toolHandler = async (invocation, threadManager) => {
|
|
const input = invocation.input;
|
|
return await threadManager.listThreads(input);
|
|
};
|
|
exports.toolHandler = toolHandler;
|