import { z } from 'zod';
import { LimitlessClient } from '../../lib/limitless-client.js';
import { Tool } from '@modelcontextprotocol/sdk/types.js';
export const starLifelogSchema = z.object({
lifelogId: z.string().describe('The ID of the lifelog to star/unstar'),
isStarred: z.boolean().describe('Set to true to star, false to unstar'),
});
export type StarLifelogParams = z.infer<typeof starLifelogSchema>;
export interface StarLifelogResponse {
success: boolean;
lifelogId: string;
isStarred: boolean;
}
export const starLifelogTool: Tool = {
name: 'limitless_star_lifelog',
description: 'Star or unstar a lifelog to mark it as important',
inputSchema: {
type: 'object',
properties: {
lifelogId: { type: 'string', description: 'The ID of the lifelog to star/unstar' },
isStarred: { type: 'boolean', description: 'Set to true to star, false to unstar' },
},
required: ['lifelogId', 'isStarred'],
},
};
export async function starLifelog(params: StarLifelogParams, client: LimitlessClient): Promise<StarLifelogResponse> {
const response = await client.patch<StarLifelogResponse>(`/lifelogs/${params.lifelogId}/star`, {
isStarred: params.isStarred,
});
return response;
}