create_linked_resource
Attach a web URL or external reference to a task in a Microsoft To Do list, enabling task linking to relevant resources.
Instructions
Attach a linked resource (URL or external ref) to a task.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| task_id | Yes | ||
| web_url | No | ||
| application_name | No | ||
| display_name | No | ||
| external_id | No | ||
| verbose | No | If true: returns full JSON. Otherwise: compact text format (default, saves tokens). |
Implementation Reference
- src/graph.ts:718-735 (handler)Core handler that sends a POST request to Microsoft Graph API to create a linked resource on a task. It takes listId, taskId, and resource fields (webUrl, applicationName, displayName, externalId) and returns the created LinkedResource.
export async function createLinkedResource( listId: string, taskId: string, resource: { webUrl?: string; applicationName?: string; displayName?: string; externalId?: string; } ): Promise<LinkedResource> { return graphFetch<LinkedResource>( `/me/todo/lists/${enc(listId)}/tasks/${enc(taskId)}/linkedResources`, { method: "POST", body: JSON.stringify(resource), } ); } - src/index.ts:250-258 (schema)Zod schema for create_linked_resource tool input validation. Defines list_id, task_id, web_url, application_name, display_name, external_id, and verbose fields.
create_linked_resource: z.object({ list_id: z.string(), task_id: z.string(), web_url: z.string().url().optional(), application_name: z.string().optional(), display_name: z.string().optional(), external_id: z.string().optional(), ...verboseField, }), - src/index.ts:1111-1120 (handler)MCP tool dispatch handler for 'create_linked_resource'. Parses args with Zod schema, calls createLinkedResource from graph.ts, and formats output via formatLinkedCompact.
case "create_linked_resource": { const a = schemas.create_linked_resource.strict().parse(args); const r = await createLinkedResource(a.list_id, a.task_id, { webUrl: a.web_url, applicationName: a.application_name, displayName: a.display_name, externalId: a.external_id, }); return out(r, a.verbose, formatLinkedCompact); } - src/index.ts:732-748 (registration)Tool registration for 'create_linked_resource' in the ListTools handler, advertising the tool name, description, and JSON input schema to MCP clients.
{ name: "create_linked_resource", description: "Attach a linked resource (URL or external ref) to a task.", inputSchema: { type: "object", properties: { list_id: { type: "string" }, task_id: { type: "string" }, web_url: { type: "string" }, application_name: { type: "string" }, display_name: { type: "string" }, external_id: { type: "string" }, ...verboseJsonProp, }, required: ["list_id", "task_id"], }, }, - src/formatters.ts:71-78 (helper)Compact text formatter for LinkedResource. Concatenates id, applicationName, displayName, webUrl, and externalId into a one-line string.
export function formatLinkedCompact(r: LinkedResource): string { const parts = [r.id]; if (r.applicationName) parts.push(`app:${r.applicationName}`); if (r.displayName) parts.push(`name:${JSON.stringify(r.displayName)}`); if (r.webUrl) parts.push(`url:${r.webUrl}`); if (r.externalId) parts.push(`ext:${r.externalId}`); return parts.join(" "); }