Skip to main content
Glama
b-open-io

Bitcoin SV MCP Server

by b-open-io

ordinals_marketListings

Discover and filter marketplace listings for Bitcoin SV ordinals, including NFTs, BSV-20, and BSV-21 tokens. Retrieve asset details, prices, and seller information with sorting and pagination options.

Instructions

Retrieves current marketplace listings for Bitcoin SV ordinals with flexible filtering. Supports multiple asset types (NFTs, BSV-20 tokens, BSV-21 tokens) through a unified interface. Results include listing prices, details about the assets, and seller information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsYes

Implementation Reference

  • Core execution logic for the ordinals_marketListings tool. Destructures input args, builds a dynamic URL query for GorillaPool API based on tokenType (NFT/BSV20/BSV21), fetches listings, and returns JSON or error.
    async (
    	{ args }: { args: MarketListingsArgs },
    	extra: RequestHandlerExtra,
    ) => {
    	try {
    		const {
    			limit,
    			offset,
    			sort,
    			dir,
    			address,
    			origin,
    			mime,
    			num,
    			minPrice,
    			maxPrice,
    			tokenType,
    			id,
    			tick,
    			pending,
    		} = args;
    
    		// Determine the API endpoint based on tokenType
    		let baseUrl = "https://ordinals.gorillapool.io/api";
    		let useTokenParams = false;
    
    		if (tokenType === "bsv20" || tokenType === "bsv21") {
    			baseUrl += "/bsv20/market";
    			useTokenParams = true;
    		} else if (tokenType === "nft" || tokenType === "all") {
    			baseUrl += "/market";
    		}
    
    		// Build the URL with query parameters
    		const url = new URL(baseUrl);
    		url.searchParams.append("limit", limit.toString());
    		url.searchParams.append("offset", offset.toString());
    		url.searchParams.append("dir", dir);
    
    		// Add sort parameter based on token type
    		if (useTokenParams) {
    			// BSV20/BSV21 specific sort options
    			if (
    				sort === "height" ||
    				sort === "price" ||
    				sort === "price_per_token"
    			) {
    				url.searchParams.append("sort", sort);
    			}
    			// Add token-specific parameters
    			if (tokenType === "bsv21") {
    				url.searchParams.append("type", "v2");
    			}
    			if (id) url.searchParams.append("id", id);
    			if (tick) url.searchParams.append("tick", tick);
    			if (pending !== undefined)
    				url.searchParams.append("pending", pending.toString());
    			// For BSV20/21, min/max price parameters have slightly different names
    			if (minPrice !== undefined)
    				url.searchParams.append("min_price", minPrice.toString());
    			if (maxPrice !== undefined)
    				url.searchParams.append("max_price", maxPrice.toString());
    		} else {
    			// NFT specific sort options
    			if (sort === "recent" || sort === "price" || sort === "num") {
    				url.searchParams.append("sort", sort);
    			}
    			// Add NFT-specific parameters
    			if (origin) url.searchParams.append("origin", origin);
    			if (mime) url.searchParams.append("mime", mime);
    			if (num) url.searchParams.append("num", num);
    			// For NFTs, min/max price parameters use short names
    			if (minPrice !== undefined)
    				url.searchParams.append("min", minPrice.toString());
    			if (maxPrice !== undefined)
    				url.searchParams.append("max", maxPrice.toString());
    		}
    
    		// Add common parameters
    		if (address) url.searchParams.append("address", address);
    
    		// Make the fetch request
    		const response = await fetch(url.toString());
    
    		if (!response.ok) {
    			throw new Error(
    				`API error: ${response.status} ${response.statusText}`,
    			);
    		}
    
    		const data = (await response.json()) as MarketListingResponse;
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: JSON.stringify(data, null, 2),
    				},
    			],
    		};
    	} catch (error) {
    		return {
    			content: [
    				{
    					type: "text",
    					text: error instanceof Error ? error.message : String(error),
    				},
    			],
    			isError: true,
    		};
    	}
    },
  • Comprehensive Zod schema for tool inputs, supporting pagination, sorting, filtering by address, price range, token type, and type-specific params for NFTs and tokens.
    export const marketListingsArgsSchema = z.object({
    	// Common parameters
    	limit: z
    		.number()
    		.int()
    		.min(1)
    		.max(100)
    		.default(20)
    		.describe("Number of results (1-100, default 20)"),
    	offset: z.number().int().min(0).default(0).describe("Pagination offset"),
    	dir: z
    		.enum(["asc", "desc"])
    		.default("desc")
    		.describe("Sort direction (asc or desc)"),
    	address: z.string().optional().describe("Bitcoin address"),
    
    	// NFT-specific parameters
    	origin: z.string().optional().describe("Origin outpoint"),
    	mime: z.string().optional().describe("MIME type filter"),
    	num: z.string().optional().describe("Inscription number"),
    
    	// General market parameters
    	minPrice: z.number().optional().describe("Minimum price in satoshis"),
    	maxPrice: z.number().optional().describe("Maximum price in satoshis"),
    
    	// Token-specific parameters
    	tokenType: z
    		.enum(["nft", "bsv20", "bsv21", "all"])
    		.default("all")
    		.describe("Type of token to search for (nft, bsv20, bsv21, or all)"),
    	sort: z
    		.enum(["recent", "price", "num", "height", "price_per_token"])
    		.default("recent")
    		.describe("Sort method (recent, price, num, height, price_per_token)"),
    	id: z.string().optional().describe("Token ID in outpoint format"),
    	tick: z.string().optional().describe("Token ticker symbol"),
    	pending: z
    		.boolean()
    		.default(false)
    		.optional()
    		.describe("Include pending sales"),
    });
  • Function that registers the ordinals_marketListings tool on the MCP server using server.tool(), linking schema and handler. Note: excerpt abbreviated for handler.
    export function registerMarketListingsTool(server: McpServer): void {
    	server.tool(
    		"ordinals_marketListings",
    		"Retrieves current marketplace listings for Bitcoin SV ordinals with flexible filtering. Supports multiple asset types (NFTs, BSV-20 tokens, BSV-21 tokens) through a unified interface. Results include listing prices, details about the assets, and seller information.",
    		{
    			args: marketListingsArgsSchema,
    		},
    		async (
    			{ args }: { args: MarketListingsArgs },
    			extra: RequestHandlerExtra,
    		) => {
    			try {
    				const {
    					limit,
    					offset,
    					sort,
    					dir,
    					address,
    					origin,
    					mime,
    					num,
    					minPrice,
    					maxPrice,
    					tokenType,
    					id,
    					tick,
    					pending,
    				} = args;
    
    				// Determine the API endpoint based on tokenType
    				let baseUrl = "https://ordinals.gorillapool.io/api";
    				let useTokenParams = false;
    
    				if (tokenType === "bsv20" || tokenType === "bsv21") {
    					baseUrl += "/bsv20/market";
    					useTokenParams = true;
    				} else if (tokenType === "nft" || tokenType === "all") {
    					baseUrl += "/market";
    				}
    
    				// Build the URL with query parameters
    				const url = new URL(baseUrl);
    				url.searchParams.append("limit", limit.toString());
    				url.searchParams.append("offset", offset.toString());
    				url.searchParams.append("dir", dir);
    
    				// Add sort parameter based on token type
    				if (useTokenParams) {
    					// BSV20/BSV21 specific sort options
    					if (
    						sort === "height" ||
    						sort === "price" ||
    						sort === "price_per_token"
    					) {
    						url.searchParams.append("sort", sort);
    					}
    					// Add token-specific parameters
    					if (tokenType === "bsv21") {
    						url.searchParams.append("type", "v2");
    					}
    					if (id) url.searchParams.append("id", id);
    					if (tick) url.searchParams.append("tick", tick);
    					if (pending !== undefined)
    						url.searchParams.append("pending", pending.toString());
    					// For BSV20/21, min/max price parameters have slightly different names
    					if (minPrice !== undefined)
    						url.searchParams.append("min_price", minPrice.toString());
    					if (maxPrice !== undefined)
    						url.searchParams.append("max_price", maxPrice.toString());
    				} else {
    					// NFT specific sort options
    					if (sort === "recent" || sort === "price" || sort === "num") {
    						url.searchParams.append("sort", sort);
    					}
    					// Add NFT-specific parameters
    					if (origin) url.searchParams.append("origin", origin);
    					if (mime) url.searchParams.append("mime", mime);
    					if (num) url.searchParams.append("num", num);
    					// For NFTs, min/max price parameters use short names
    					if (minPrice !== undefined)
    						url.searchParams.append("min", minPrice.toString());
    					if (maxPrice !== undefined)
    						url.searchParams.append("max", maxPrice.toString());
    				}
    
    				// Add common parameters
    				if (address) url.searchParams.append("address", address);
    
    				// Make the fetch request
    				const response = await fetch(url.toString());
    
    				if (!response.ok) {
    					throw new Error(
    						`API error: ${response.status} ${response.statusText}`,
    					);
    				}
    
    				const data = (await response.json()) as MarketListingResponse;
    
    				return {
    					content: [
    						{
    							type: "text",
    							text: JSON.stringify(data, null, 2),
    						},
    					],
    				};
    			} catch (error) {
    				return {
    					content: [
    						{
    							type: "text",
    							text: error instanceof Error ? error.message : String(error),
    						},
    					],
    					isError: true,
    				};
    			}
    		},
    	);
    }
  • Invocation of the register function within the ordinals tools aggregator.
    registerMarketListingsTool(server);
  • tools/index.ts:90-90 (registration)
    Top-level registration call for all ordinals tools, including marketListings.
    registerOrdinalsTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool 'retrieves' listings and includes details like prices and seller info, but fails to describe critical behaviors such as pagination handling (implied by 'offset' and 'limit' parameters), rate limits, authentication requirements, error conditions, or the structure of returned results. For a tool with 14 parameters and no output schema, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized at three sentences, front-loaded with the core purpose. Each sentence adds value: the first states the action and scope, the second details asset types, and the third specifies result contents. There's no redundant information, and it's structured for quick comprehension.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (14 parameters, nested objects, no annotations, no output schema), the description is incomplete. It covers the purpose and result types but lacks essential context such as behavioral traits (e.g., pagination, errors), detailed parameter guidance, and differentiation from siblings. Without an output schema, the description should ideally explain return values, but it only mentions them superficially ('listing prices, details about the assets, and seller information').

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning all 14 parameters lack descriptions in the schema. The description compensates partially by mentioning 'flexible filtering' and listing the types of results included (prices, asset details, seller information), which hints at parameters like 'minPrice', 'maxPrice', and 'tokenType'. However, it doesn't explain the semantics of most parameters (e.g., 'id', 'origin', 'pending'), leaving many undocumented. Baseline is 3 due to some compensation but incomplete coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Retrieves current marketplace listings for Bitcoin SV ordinals with flexible filtering.' It specifies the resource (marketplace listings) and the action (retrieves), and mentions support for multiple asset types. However, it doesn't explicitly differentiate from sibling tools like 'ordinals_marketSales' or 'ordinals_searchInscriptions', which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It mentions 'flexible filtering' but doesn't specify scenarios where this tool is preferred over siblings like 'ordinals_marketSales' (which might retrieve sales history) or 'ordinals_searchInscriptions' (which might search inscriptions without marketplace context). No explicit when/when-not instructions or named alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/b-open-io/bsv-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server