amazon-seller-mcp
Version:
Model Context Protocol (MCP) client for Amazon Selling Partner API
247 lines (246 loc) • 5.07 kB
TypeScript
/**
* Catalog API client for Amazon Selling Partner API
*/
import { BaseApiClient } from './base-client.js';
import { AuthConfig } from '../types/auth.js';
import { AmazonItemAttributes, AmazonItemIdentifiers, AmazonItemRelationships } from '../types/amazon-api.js';
/**
* Parameters for retrieving a catalog item
*/
export interface GetCatalogItemParams {
/**
* Amazon Standard Identification Number (ASIN)
*/
asin: string;
/**
* List of included data sets
*/
includedData?: Array<'attributes' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'variations'>;
/**
* Locale for localized fields
*/
locale?: string;
}
/**
* Parameters for searching catalog items
*/
export interface SearchCatalogItemsParams {
/**
* Search keywords
*/
keywords?: string;
/**
* List of brand names
*/
brandNames?: string[];
/**
* List of classification IDs
*/
classificationIds?: string[];
/**
* Page size (1-20)
*/
pageSize?: number;
/**
* Page token for pagination
*/
pageToken?: string;
/**
* List of included data sets
*/
includedData?: Array<'attributes' | 'identifiers' | 'images' | 'productTypes' | 'relationships' | 'salesRanks' | 'summaries' | 'variations'>;
/**
* Locale for localized fields
*/
locale?: string;
}
/**
* Catalog item image
*/
export interface CatalogItemImage {
/**
* Image URL
*/
link: string;
/**
* Image height
*/
height: number;
/**
* Image width
*/
width: number;
}
/**
* Catalog item sales rank
*/
export interface CatalogItemSalesRank {
/**
* Sales rank title
*/
title: string;
/**
* Sales rank link
*/
link: string;
/**
* Sales rank
*/
rank: number;
}
/**
* Catalog item summary
*/
export interface CatalogItemSummary {
/**
* Marketplace ID
*/
marketplaceId: string;
/**
* Brand name
*/
brandName?: string;
/**
* Color name
*/
colorName?: string;
/**
* Item name
*/
itemName?: string;
/**
* Manufacturer
*/
manufacturer?: string;
/**
* Model number
*/
modelNumber?: string;
}
/**
* Catalog item
*/
export interface CatalogItem {
/**
* Amazon Standard Identification Number (ASIN)
*/
asin: string;
/**
* Item attributes
*/
attributes?: AmazonItemAttributes;
/**
* Item identifiers
*/
identifiers?: AmazonItemIdentifiers;
/**
* Item images
*/
images?: Record<string, CatalogItemImage[]>;
/**
* Product types
*/
productTypes?: Record<string, string>;
/**
* Item relationships
*/
relationships?: AmazonItemRelationships;
/**
* Sales ranks
*/
salesRanks?: Record<string, CatalogItemSalesRank[]>;
/**
* Item summaries
*/
summaries?: CatalogItemSummary[];
}
/**
* Catalog item search result
*/
export interface CatalogItemSearchResult {
/**
* Number of results
*/
numberOfResults: number;
/**
* Pagination token
*/
pagination?: {
/**
* Next page token
*/
nextToken?: string;
/**
* Previous page token
*/
previousToken?: string;
};
/**
* Refinements
*/
refinements?: {
/**
* Brands
*/
brands?: Array<{
/**
* Brand name
*/
name: string;
/**
* Number of results
*/
numberOfResults: number;
}>;
/**
* Classifications
*/
classifications?: Array<{
/**
* Classification ID
*/
id: string;
/**
* Classification name
*/
name: string;
/**
* Number of results
*/
numberOfResults: number;
}>;
};
/**
* Search items
*/
items: CatalogItem[];
}
/**
* Catalog API client for Amazon Selling Partner API
*/
export declare class CatalogClient extends BaseApiClient {
/**
* API version
*/
private readonly apiVersion;
/**
* Create a new CatalogClient instance
*
* @param authConfig Authentication configuration
*/
constructor(authConfig: AuthConfig);
/**
* Get a catalog item by ASIN
*
* @param params Parameters for retrieving a catalog item
* @returns Promise resolving to the catalog item
*/
getCatalogItem(params: GetCatalogItemParams): Promise<CatalogItem>;
/**
* Search catalog items
*
* @param params Parameters for searching catalog items
* @returns Promise resolving to the search results
*/
searchCatalogItems(params: SearchCatalogItemsParams): Promise<CatalogItemSearchResult>;
}