capacities_save_weblink
Store web links in a Capacities space with custom titles, descriptions, tags, and markdown notes for organized knowledge management.
Instructions
Save a web link to a Capacities space with optional title and tags
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| descriptionOverwrite | No | Optional description for the weblink | |
| mdText | No | Text formatted as markdown that will be added to the notes section | |
| spaceId | Yes | The UUID of the space to save the weblink to | |
| tags | No | Optional Tags to add to the weblink. Tags need to exactly match your tag names in Capacities, otherwise they will be created. | |
| titleOverwrite | No | Optional custom title for the weblink | |
| url | Yes | The URL to save |
Implementation Reference
- src/tools/saveWeblink.ts:12-53 (handler)The asynchronous execute function that implements the core logic of the 'capacities_save_weblink' tool. It constructs a request body from the input arguments and makes a POST request to the '/save-weblink' API endpoint using makeApiRequest, handling success and error responses.execute: async (args: { spaceId: string; url: string; titleOverwrite?: string; descriptionOverwrite?: string; tags?: string[]; mdText?: string; }) => { try { const requestBody = { spaceId: args.spaceId, url: args.url, ...(args.titleOverwrite && { titleOverwrite: args.titleOverwrite }), ...(args.descriptionOverwrite && { descriptionOverwrite: args.descriptionOverwrite, }), ...(args.tags && { tags: args.tags }), ...(args.mdText && { mdText: args.mdText }), }; const response = await makeApiRequest("/save-weblink", { method: "POST", body: JSON.stringify(requestBody), }); const responseText = await response.text(); if (!responseText.trim()) { return "Success: Weblink saved (no response data)"; } try { const data = JSON.parse(responseText); return JSON.stringify(data, null, 2); } catch (parseError) { return `Success: Weblink saved. Response: ${responseText}`; } } catch (error) { throw new Error( `Failed to save weblink: ${error instanceof Error ? error.message : String(error)}`, ); } },
- src/tools/saveWeblink.ts:55-86 (schema)Zod schema defining the input parameters for the tool, including required spaceId and url, and optional fields like titleOverwrite, descriptionOverwrite, tags, and mdText with descriptions and validations.parameters: z.object({ spaceId: z .string() .uuid() .describe("The UUID of the space to save the weblink to"), url: z.string().url().describe("The URL to save"), titleOverwrite: z .string() .max(500) .optional() .describe("Optional custom title for the weblink"), descriptionOverwrite: z .string() .max(500) .optional() .describe("Optional description for the weblink"), tags: z .array(z.string()) .max(30) .optional() .describe( "Optional Tags to add to the weblink. Tags need to exactly match your tag names in Capacities, otherwise they will be created.", ), mdText: z .string() .max(200000) .optional() .describe( "Text formatted as markdown that will be added to the notes section", ), }), };
- src/server.ts:27-27 (registration)Registers the saveWeblinkTool (which has name 'capacities_save_weblink') with the FastMCP server instance.server.addTool(saveWeblinkTool);