Bug
create_link and update_link return an Internal Server Error whenever the request includes a data payload or tags array, and neither field is ever persisted -- even on calls where the error fires, other fields in the same request (e.g. title, subtitle) do still save correctly, so this isn't a total request failure, just these two fields.
Root cause (found in src/api-client.ts)
CreateLinkData/UpdateLinkData type data as Record<string, unknown> and tags as string[] (lines ~94-95, ~123-124), and the request body is stringified once as a whole:
...(body !== undefined ? { body: JSON.stringify(body) } : {}),
But per docs.grovs.io/docs/api-reference/generate-link, the underlying Grovs REST API expects data to be a stringified JSON string as its value (e.g. "data": "{\"screen\": \"promo\"}"), not a nested raw object. Stringifying the outer body once nests data as a raw object instead of double-encoding it as the API expects -- the MCP server is missing a JSON.stringify() pass on data (and apparently tags, which fails the same way) before it goes into the outer body.
Repro
Via the MCP tools directly:
update_link with only title/subtitle → succeeds, both persist (confirmed via get_link).
update_link with tags: ["referral"] alone → Internal Server Error; get_link afterward shows no tags field at all.
update_link with data: {"referralCode": "some-code"} alone → Internal Server Error; get_link afterward shows no data field at all.
name, title, subtitle, path, image_url all work individually and combined -- it's specifically data and tags that fail.
Suggested fix
Stringify data (and tags, if the REST API expects the same treatment there) individually before assembling the outer body, e.g.:
JSON.stringify({ ...rest, data: data ? JSON.stringify(data) : undefined })
Happy to help verify a fix against a real project if useful.
Bug
create_linkandupdate_linkreturn an Internal Server Error whenever the request includes adatapayload ortagsarray, and neither field is ever persisted -- even on calls where the error fires, other fields in the same request (e.g.title,subtitle) do still save correctly, so this isn't a total request failure, just these two fields.Root cause (found in
src/api-client.ts)CreateLinkData/UpdateLinkDatatypedataasRecord<string, unknown>andtagsasstring[](lines ~94-95, ~123-124), and the request body is stringified once as a whole:But per
docs.grovs.io/docs/api-reference/generate-link, the underlying Grovs REST API expectsdatato be a stringified JSON string as its value (e.g."data": "{\"screen\": \"promo\"}"), not a nested raw object. Stringifying the outer body once nestsdataas a raw object instead of double-encoding it as the API expects -- the MCP server is missing aJSON.stringify()pass ondata(and apparentlytags, which fails the same way) before it goes into the outer body.Repro
Via the MCP tools directly:
update_linkwith onlytitle/subtitle→ succeeds, both persist (confirmed viaget_link).update_linkwithtags: ["referral"]alone → Internal Server Error;get_linkafterward shows no tags field at all.update_linkwithdata: {"referralCode": "some-code"}alone → Internal Server Error;get_linkafterward shows no data field at all.name,title,subtitle,path,image_urlall work individually and combined -- it's specificallydataandtagsthat fail.Suggested fix
Stringify
data(andtags, if the REST API expects the same treatment there) individually before assembling the outer body, e.g.:Happy to help verify a fix against a real project if useful.