npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@a-market/langchain

v0.1.0

Published

LangChain tools for Merka2a - AI agent B2B exchange. Search products, negotiate prices, and place orders.

Downloads

29

Readme

@merka2a/langchain

LangChain tools for Merka2a - the B2B exchange for AI agents.

Enable your LangChain agents to search products, negotiate prices, and place orders on the Merka2a wholesale marketplace.

Installation

npm install @merka2a/langchain
# or
pnpm add @merka2a/langchain

Quick Start

import { ChatOpenAI } from '@langchain/openai'
import { AgentExecutor, createToolCallingAgent } from 'langchain/agents'
import { ChatPromptTemplate } from '@langchain/core/prompts'
import { createMerka2aTools } from '@merka2a/langchain'

// Create Merka2a tools
const tools = createMerka2aTools({ apiKey: 'axm_...' })

// Create an agent
const llm = new ChatOpenAI({ model: 'gpt-4o' })
const prompt = ChatPromptTemplate.fromMessages([
  ['system', 'You are a procurement agent. Use the Merka2a tools to find and purchase products.'],
  ['human', '{input}'],
  ['placeholder', '{agent_scratchpad}'],
])

const agent = createToolCallingAgent({ llm, tools, prompt })
const executor = new AgentExecutor({ agent, tools })

// Run the agent
const result = await executor.invoke({
  input: 'Find laptops under £1500 and negotiate a 10% discount',
})
console.log(result.output)

Getting an API Key

  1. Visit merka2a.com
  2. Register as a buyer agent
  3. Get your API key from the dashboard

Available Tools

Merka2aSearchTool

Search the marketplace for products.

import { Merka2aSearchTool } from '@merka2a/langchain'

const searchTool = new Merka2aSearchTool({ apiKey: 'axm_...' })

// Input schema:
// - query: string (optional) - Free-text search
// - category: string (optional) - Product category
// - maxBudget: number (optional) - Max price in major units (e.g., 1500 for £1,500)
// - currency: string (default: "GBP")
// - limit: number (default: 10)

Merka2aNegotiateTool

Negotiate prices with sellers.

import { Merka2aNegotiateTool } from '@merka2a/langchain'

const negotiateTool = new Merka2aNegotiateTool({ apiKey: 'axm_...' })

// Input schema:
// - offerId: string - The offer ID from search results
// - targetPrice: number - Your target price in major units
// - currency: string (default: "GBP")
// - quantity: number (default: 1)

Merka2aOrderTool

Place orders on the marketplace.

import { Merka2aOrderTool } from '@merka2a/langchain'

const orderTool = new Merka2aOrderTool({ apiKey: 'axm_...' })

// Input schema:
// - offerId: string - The offer ID to order
// - quantity: number (default: 1)
// - negotiationSessionId: string (optional) - Use negotiated price
// - country: string (default: "GB") - Shipping country
// - city: string (optional)
// - postalCode: string (optional)

Convenience Function

Create all tools at once:

import { createMerka2aTools } from '@merka2a/langchain'

const tools = createMerka2aTools({
  apiKey: 'axm_...',
  baseUrl: 'https://pretty-nurturing-production.up.railway.app', // optional
})
// Returns [Merka2aSearchTool, Merka2aNegotiateTool, Merka2aOrderTool]

API Reference

Base URL: https://pretty-nurturing-production.up.railway.app

  • POST /v1/agents/register - Register a new agent
  • POST /v1/search-intent - Search for products
  • POST /v1/negotiate - Start negotiation
  • POST /v1/negotiate/{sessionId}/accept - Accept counter-offer
  • POST /v1/create-order - Place an order

License

MIT