Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to LinkHut

Scalekit connector
Open markdown

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 app
Your own LinkHut app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. 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>
  3. Create the LinkHut connection

    In AgentKit > Connections, create a LinkHut connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. 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.

  5. 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.actions
    const connector = 'linkhut'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { 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 call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'linkhut_get_last_update',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • linkhut_get_last_updateGet the timestamp of the most recent bookmark change in the account.Read-only

    Get 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-only

    Get 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-only

    List 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-only

    List 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-only

    List 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_list_tagsList all of the user's tags with how many bookmarks use each.Read-only

    List Tags

    List all of the user's tags with how many bookmarks use each. Returns an object mapping tag name to usage count. Use to see existing tags before linkhut_rename_tag or linkhut_delete_tag.

    Inputs

    This tool takes no inputs.

  • linkhut_suggest_tagsSuggest tags for a URL from site-wide popular tags and the user's own tags.Read-only

    Suggest Tags

    Suggest tags for a URL from site-wide popular tags and the user's own tags. Returns two lists, popular and recommended, of tag names. Use before linkhut_add_post to choose tags for a new bookmark.

    Inputs

    urlstringrequired
    URL to get tag suggestions for.
  • linkhut_add_postSave a bookmark with a title, optional notes and tags.Write

    Add 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