The LinkHut connector lets your AI agent act in each user's LinkHut account. Each user signs in to LinkHut once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 11 tools.
- Tools
- 11
- What they doRead · write · destructive
- 7 · 2 · 27 read2 write2 destructive
- Users sign in with
- OAuth
- OAuth app
- Your own LinkHut app
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the LinkHut connection
In AgentKit > Connections, create a LinkHut connection and copy its redirect URI. The name you give it is the
connection_nameyour code passes. See Configure connections.Register an OAuth app
LinkHut connections use your own OAuth app. Register one with LinkHut and add the redirect URI you copied.
Then enter the app's Client ID and Client Secret on the LinkHut connection.
Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'linkhut'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize LinkHut:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'linkhut_get_last_update',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "linkhut"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize LinkHut:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="linkhut_get_last_update",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user signs in once. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toollinkhut_get_last_updateGet the timestamp of the most recent bookmark change in the account.Read-onlyGet Last Update
Get the timestamp of the most recent bookmark change in the account. Returns update_time as an ISO 8601 UTC string. Use it to check whether bookmarks changed before calling linkhut_list_all_posts.
Inputs
This tool takes no inputs.
linkhut_get_postsGet bookmarks matching a date, URL, tag or URL hash filter.Read-onlyGet Bookmarks
Get bookmarks matching a date, URL, tag or URL hash filter. Returns a posts list with href, description, extended notes, hash, tags, time, shared and toread. With no date or URL it uses the most recent day that has bookmarks. Use for lookups of specific bookmarks. Use linkhut_list_recent_posts for the latest ones and linkhut_list_all_posts for everything.
Inputs
dtstring- Return bookmarks from this day; defaults to the most recent day with bookmarks.
hashesstring- MD5 hashes of URLs to fetch, separated by spaces, regardless of date.
metastring- Set to yes to include a change-detection signature in each bookmark's meta field.one of
yes tagstring- Tags to filter by, separated by spaces for more than one, for example webdev dom.
urlstring- Return the bookmark for this exact URL regardless of date.
linkhut_list_all_postsList all bookmarks in the account with optional tag, date range and paging filters.Read-onlyList All Bookmarks
List all bookmarks in the account with optional tag, date range and paging filters. Returns an array of bookmarks with href, description, extended notes, hash, tags, time, shared and toread. Up to 1000 are returned by default. Use sparingly: check linkhut_get_last_update first, and use linkhut_list_recent_posts for a few items.
Inputs
fromdtstring- Only return bookmarks saved on or after this time.
metastring- Set to yes to include a change-detection signature in each bookmark's meta field.one of
yes resultsinteger- Maximum number of bookmarks to return; the server default is 1000.
startinteger- Number of results to skip before returning bookmarks.
tagstring- Only return bookmarks with this tag.
todtstring- Only return bookmarks saved on or before this time.
linkhut_list_post_datesList the dates on which bookmarks were saved with the count for each date.Read-onlyList Bookmark Dates
List the dates on which bookmarks were saved with the count for each date. Returns a dates object mapping YYYY-MM-DD to bookmark count. Use to find which days have bookmarks before calling linkhut_get_posts with a date.
Inputs
tagstring- Only count bookmarks with this tag.
linkhut_list_recent_postsList the most recently saved bookmarks, optionally filtered by tag.Read-onlyList Recent Bookmarks
List the most recently saved bookmarks, optionally filtered by tag. Returns a posts list with href, description, extended notes, hash, tags, time, shared and toread. Use for the latest bookmarks. Use linkhut_get_posts for a specific date or URL.
Inputs
countinteger- Number of bookmarks to return, from 1 to 100; the server default is 15.
tagstring- Only return bookmarks with this tag.
linkhut_add_postSave a bookmark with a title, optional notes and tags.WriteAdd Bookmark
Save a bookmark with a title, optional notes and tags. Returns result_code, which is done on success. Use to create or overwrite a bookmark for a URL. Use linkhut_delete_post to remove one.
- Idempotent
Inputs
descriptionstringrequired- Title of the bookmark.
urlstringrequired- URL to bookmark, for example https://sourcehut.org/.
dtstring- Creation time to record for the bookmark; defaults to now.
extendedstring- Notes or long description for the bookmark.
replacestring- Set to no to keep the existing bookmark when the URL is already saved; the server replaces it by default.one of
yesno sharedstring- Set to no to make the bookmark private.one of
yesno tagsstring- Comma-delimited tags to attach, for example git,oss.
toreadstring- Set to yes to mark the bookmark as unread.one of
yesno
linkhut_rename_tagRename a tag across all bookmarks.WriteRename Tag
Rename a tag across all bookmarks. Returns result_code, which is done on success. Use linkhut_list_tags first to find the current tag name.
Inputs
newstringrequired- New name for the tag.
oldstringrequired- Current name of the tag to rename.
linkhut_delete_postDelete the bookmark saved for a URL.DestructiveDelete Bookmark
Delete the bookmark saved for a URL. Returns result_code, which is done on success. Use linkhut_get_posts first to confirm the bookmark exists.
- Idempotent
Inputs
urlstringrequired- URL of the bookmark to delete.
linkhut_delete_tagRemove a tag from every bookmark that has it.DestructiveDelete Tag
Remove a tag from every bookmark that has it. Returns result_code, which is done on success. The bookmarks themselves are kept. Use linkhut_list_tags first to confirm the tag name. Use linkhut_rename_tag to keep the bookmarks grouped.
- Idempotent
Inputs
tagstringrequired- Name of the tag to remove from all bookmarks.
No tools match.