memory_stream_resume
Resume previous memory streams to restore context and knowledge for LLMs, enabling continuous learning across sessions through the Model Context Protocol.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "memory_stream_resume"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler function that executes the memory_stream_resume tool logic by calling StreamingManager.resumeStream and formatting the response.
async handleStreamResume(args) { try { const result = await this.streamingManager.resumeStream(args.streamId); return { content: [ { type: 'text', text: JSON.stringify({ success: true, streamId: args.streamId, status: result.status, message: 'Stream resumed successfully', }), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify({ success: false, error: error.message, }), }, ], isError: true, }; } - src/tools/modules/MemoryStreamingTools.js:138-154 (registration)Registers the memory_stream_resume tool with the server, including input schema and handler reference.
server.registerTool( 'memory_stream_resume', 'Resume a paused streaming query', { type: 'object', properties: { streamId: { type: 'string', description: 'The stream ID to resume', }, }, required: ['streamId'], }, async (args) => { return await this.handleStreamResume(args); } ); - Input schema defining the parameters for the memory_stream_resume tool.
{ type: 'object', properties: { streamId: { type: 'string', description: 'The stream ID to resume', }, }, required: ['streamId'], }, - Core helper method that resumes a paused stream by updating its status and adjusting timing.
async resumeStream(streamId) { const stream = this.activeStreams.get(streamId); if (!stream) { throw new Error(`Stream ${streamId} not found`); } if (stream.status !== 'paused') { throw new Error(`Stream ${streamId} is not paused`); } stream.status = 'active'; if (stream.pausedAt) { // Adjust start time to account for pause duration const pauseDuration = Date.now() - stream.pausedAt; stream.startTime += pauseDuration; delete stream.pausedAt; } return { streamId, status: 'active', progress: { current: stream.currentIndex, total: stream.totalFacts, }, }; }