Skip to main content
Glama

mcp-google-sheets

find-task.action.ts1.16 kB
import { todoistAuth } from '../..'; import { createAction, Property } from '@activepieces/pieces-framework'; import { todoistProjectIdDropdown } from '../common/props'; import { todoistRestClient } from '../common/client/rest-client'; import { assertNotNullOrUndefined } from '@activepieces/shared'; export const todoistFindTaskAction = createAction({ auth: todoistAuth, name: 'find_task', displayName: 'Find Task', description: 'Finds a task by name.', props: { name: Property.ShortText({ displayName: 'Name', description: 'The name of the task to search for.', required: true, }), project_id: todoistProjectIdDropdown( 'Search for tasks within the selected project. If left blank, then all projects are searched.', ), }, async run(context) { const token = context.auth.access_token; const { name, project_id } = context.propsValue; assertNotNullOrUndefined(token, 'token'); const tasks = await todoistRestClient.tasks.list({ token, project_id }); const matchedTask = tasks.find((task) => task.content == name); if (!matchedTask) { throw new Error('Task not found'); } else { return matchedTask; } }, });

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/activepieces/activepieces'

If you have feedback or need assistance with the MCP directory API, please join our Discord server