{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown","redocly_category":"MCP Server","api_domain":"MCP"},"seo":{"title":"MCP Server recipes","description":"Practical patterns for querying and changing Sales Layer Catalog data and DAM assets through an AI assistant with the MCP Server.","siteUrl":"https://docs.api.saleslayer.com/","image":"/assets/sales-layer-horizontal-dark-green.224c048d0bb386d3c2683ba504140512b6233d3c6cbf706ca81e2e3f2f02dbd0.9c1bb791.svg","keywords":["Sales Layer","Sales Layer API","REST API","OpenAPI","PIM API","Product Information Management API","DAM API","Catalog API","product catalog API","product data synchronization","ecommerce integration API","ERP integration","marketplace integration","image management API","digital asset management API","API integration","Model Context Protocol","MCP server","Sales Layer MCP","AI assistant connector","PIM AI assistant"],"lang":"en-US","meta":[{"name":"og:type","content":"website"},{"name":"og:site_name","content":"Sales Layer REST API Documentation"},{"name":"og:title","content":"Sales Layer REST API Documentation"},{"name":"og:description","content":"Technical REST API docs for Sales Layer PIM, Catalog, DAM, ecommerce, ERP, and marketplace integrations."},{"name":"og:image","content":"/assets/sales-layer-horizontal-dark-green.224c048d0bb386d3c2683ba504140512b6233d3c6cbf706ca81e2e3f2f02dbd0.9c1bb791.svg"},{"name":"twitter:card","content":"summary_large_image"},{"name":"twitter:site","content":"@saleslayer"},{"name":"twitter:title","content":"Sales Layer REST API Documentation"},{"name":"twitter:description","content":"Technical REST API docs for Sales Layer PIM, Catalog, DAM, ecommerce, ERP, and marketplace integrations."},{"name":"twitter:image","content":"/assets/sales-layer-horizontal-dark-green.224c048d0bb386d3c2683ba504140512b6233d3c6cbf706ca81e2e3f2f02dbd0.9c1bb791.svg"}],"llmstxt":{"hide":false,"title":"Sales Layer REST API Documentation","description":"Technical guides and OpenAPI references for Sales Layer DAM and Catalog REST APIs.","sections":[{"title":"Guides","description":"Static API guides for authentication, headers, query parameters, responses, rate limiting, and best practices.","includeFiles":["guides/**/*.md","changelog.md"]},{"title":"API Reference","description":"OpenAPI-based references and API overview pages for Sales Layer REST APIs.","includeFiles":["apis/**/*.md","apis/**/*.yaml"]},{"title":"Postman collections","description":"Importable Postman collection and environment instructions for testing Sales Layer REST APIs.","includeFiles":["postman/**/*.md"]},{"title":"MCP server","description":"Documentation for the Sales Layer MCP Server, its tools, access profiles, and how AI assistants consume the Catalog REST API.","includeFiles":["mcp-server/**/*.md"]}]},"jsonLd":{"@context":"https://schema.org","@type":"WebSite","name":"Sales Layer REST API Documentation","url":"https://docs.api.saleslayer.com/","publisher":{"@type":"Organization","name":"Sales Layer","url":"https://www.saleslayer.com/"}}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"mcp-server-recipes","__idx":0},"children":["MCP Server recipes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Worked patterns for getting useful results out of an MCP-connected assistant. Each one shows what to ask, which tools it exercises, and what to watch for."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All read recipes work under the Read-only profile. The enrichment recipes at the end need Full access."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"get-oriented-in-a-new-catalog","__idx":1},"children":["Get oriented in a new catalog"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before asking anything specific, establish what exists."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What tables are in my catalog, and how many records does each one have?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_custom_entities"]}," followed by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_entity_counts"]},", and gives you standard tables plus any custom entities with their record counts."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then narrow to the table you care about:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Give me a complete picture of the Products table — how many records, which fields, and which are multilingual."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_table_info"]},", which returns counts, fields with human-readable titles, types, multilingual flags, and pagination limits in one call."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ask for languages explicitly if you will be working with translations:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Which languages are configured in this catalog, and which fields are multilingual?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["That runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_catalog_locales"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"search-a-multilingual-catalog","__idx":2},"children":["Search a multilingual catalog"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the most common source of empty results. A plain text search covers the default language only, so a Spanish term will not match content stored in English."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Instead of relying on a bare search, name the language:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find products with \"Abrigo\" in the Spanish title."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_products"]}," with a filter such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["contains(prod_title_es, 'Abrigo')"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you are unsure which language holds the data, ask for both:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find products with \"Coat\" in English or \"Abrigo\" in Spanish."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a search comes back empty and you suspect a language mismatch:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How should I search this catalog across multiple languages?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["That runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["help_search_multilingual"]},", which reports the configured languages and shows patterns using your real field names."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keep in mind that an empty value for a language means the field is not translated. It does not fall back to the base language."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"audit-data-quality","__idx":3},"children":["Audit data quality"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Counting before listing keeps responses manageable."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How many products are visible, and how many are drafts?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_total_count"]}," twice with filters on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["prod_stat"]},", without downloading records."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then find the gaps:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List visible products that have no English description. Show reference and title."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Which categories have no products assigned?"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show me products whose title exists in English but not in Spanish."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the last one, ask the assistant to select both language fields explicitly, so untranslated values are visible as empty rather than absent."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"explore-structure-before-building-a-rest-integration","__idx":4},"children":["Explore structure before building a REST integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The MCP Server is a fast way to understand a catalog you are about to integrate with over the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/catalog"},"children":["Catalog REST API"]},"."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What fields does the Products table have, with their types and which ones are images or files?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_entity_fields"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["field_type"]}," filtering."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["I want to fetch all visible products with their images, as efficiently as possible. What query should I use?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["suggest_optimal_query"]},", which proposes filters, field selection, and performance settings. Treat the result as a starting point and verify it against ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/filter"},"children":["Filter"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/select"},"children":["Select"]}," before putting it in production code."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"work-through-large-result-sets","__idx":5},"children":["Work through large result sets"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ask for the shape of the data before the data itself."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How many products match status visible and category SUMMER2024?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then request a first page, and continue:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show me the first page of those products."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Get the next page."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The second request runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_next_page"]}," using the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@nextLink"]}," from the previous response, which preserves the original filters. Page size limits vary by entity — ask the assistant to check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_pagination_info"]}," rather than assuming a number."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For large exports, the REST API is the better tool. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/pagination-strategies"},"children":["Pagination strategies"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"navigate-relationships","__idx":6},"children":["Navigate relationships"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two shortcuts avoid hand-built filters."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show me all products in the Summer 2024 category."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The assistant resolves the category reference to its numeric ID, then calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_category_products"]},"."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What variants does product 42PH220506712 have?"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Same pattern with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_product_variants"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Both relationship tools require the numeric internal ID. The assistant can resolve it from the business reference with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_categories"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_products"]}," first."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"review-changes-with-changelogs","__idx":7},"children":["Review changes with changelogs"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use resource changelogs when you need to understand what changed without downloading every current record."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show Product changes since yesterday, newest first."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_products_changelog"]}," with a date filter and descending order. For one known Product,"," ","ask for its numeric ID first and then use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_product_changelog"]},". Equivalent tools exist for"," ","Categories, Variants, and Custom Entities."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"inspect-attribute-sets-and-layouts","__idx":8},"children":["Inspect Attribute Sets and layouts"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List the Attribute Sets in this catalog, then show me the Product and Variant layout for the set used by product COAT001."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This combines ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_attribute_sets"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_products"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_attribute_set"]},". Attribute Set and"," ","layout writes replace complete structures, so always fetch the current value before proposing a"," ","change."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"enrich-content","__idx":9},"children":["Enrich content"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These need Full access. Read the current record first and keep your MCP client's tool approval enabled."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start narrow and verify:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Show the current titles for product COAT001. Do not change anything yet."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After reviewing the result, ask:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Update the Spanish title of product COAT001 to \"Abrigo de Lana Merino\"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The assistant calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["update_product"]},". This dedicated update tool executes when called; it does not"," ","provide a server-side preview. The separate read and your client's approval prompt are the review"," ","steps."]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set product COAT001 to draft status."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For anything touching more than one record, ask for the list first:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["List the visible products with no Spanish description."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then work through them deliberately rather than asking for a blanket update. A bulk instruction gives you one preview for many changes, which is exactly the situation where an error is easiest to approve by accident."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Test enrichment flows against a non-production catalog before running them against live data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom Entity create/update/delete tools do have a two-step preview. Category, Product, and Variant"," ","deletes also require a second call with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["confirm: true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"work-with-dam-assets","__idx":10},"children":["Work with DAM assets"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Find PDF files whose name contains \"datasheet\" and show whether each one is still linked."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This runs ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dam_filter_files"]},". Before deleting a file, inspect its ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["numLinks"]}," value with"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dam_get_file"]},"; deletion does not repoint Catalog records."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For images, account for asynchronous processing:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Import the image at https://example.com/images/coat-front.jpg, then check when it is ready."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dam_create_image"]},", followed by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dam_get_image"]}," until the status reaches ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ok"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Er"]},"."," ","DAM writes execute when called and do not implement a server-side confirmation step."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"diagnose-a-session","__idx":11},"children":["Diagnose a session"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When something behaves oddly:"]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate my token and tell me which catalog it points to."]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The catalog was updated outside this session and I am seeing stale data."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The second prompt leads to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cache_clear"]},", which needs Full access. Under Read-only, start a new session instead."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-server/troubleshooting"},"children":["Troubleshooting"]}," for connection-level problems."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-pages","__idx":12},"children":["Related pages"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-server/tools"},"children":["Tool reference"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-server/permissions"},"children":["Access profiles and permissions"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/mcp-server/troubleshooting"},"children":["Troubleshooting"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/recipes"},"children":["REST API recipes"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/best-practices"},"children":["Best practices"]}]}]}]},"headings":[{"value":"MCP Server recipes","id":"mcp-server-recipes","depth":1},{"value":"Get oriented in a new catalog","id":"get-oriented-in-a-new-catalog","depth":2},{"value":"Search a multilingual catalog","id":"search-a-multilingual-catalog","depth":2},{"value":"Audit data quality","id":"audit-data-quality","depth":2},{"value":"Explore structure before building a REST integration","id":"explore-structure-before-building-a-rest-integration","depth":2},{"value":"Work through large result sets","id":"work-through-large-result-sets","depth":2},{"value":"Navigate relationships","id":"navigate-relationships","depth":2},{"value":"Review changes with changelogs","id":"review-changes-with-changelogs","depth":2},{"value":"Inspect Attribute Sets and layouts","id":"inspect-attribute-sets-and-layouts","depth":2},{"value":"Enrich content","id":"enrich-content","depth":2},{"value":"Work with DAM assets","id":"work-with-dam-assets","depth":2},{"value":"Diagnose a session","id":"diagnose-a-session","depth":2},{"value":"Related pages","id":"related-pages","depth":2}],"frontmatter":{"seo":{"title":"MCP Server recipes","description":"Practical patterns for querying and changing Sales Layer Catalog data and DAM assets through an AI assistant with the MCP Server."},"keywords":{"includes":["MCP recipes","AI assistant catalog","PIM data quality","multilingual product search","Model Context Protocol"]},"metadata":{"redocly_category":"MCP Server","api_domain":"MCP"}},"lastModified":"2026-08-31T15:07:55.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/mcp-server/recipes","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}