create-grant

Original🇺🇸 English
Translated

Add a grant (funding) to an existing Karma project. Use when user says "add a grant", "record funding", "create grant", "add funding to project", or "received a grant".

4installs
Added on

NPX Install

npx skill4agent add show-karma/skills create-grant

Tags

Translated version includes tags in frontmatter

Create Grant

Add a grant (funding record) to an existing project. This creates two on-chain attestations: Grant + GrantDetails.
See Agent API Reference for auth, base URL, and error handling.

Prerequisite

If
KARMA_API_KEY
is not set in the environment, invoke the
/setup-agent
skill first, then continue with this skill.

Required Information

FieldRequiredDescription
chainId
YesChain where the project lives
projectUID
YesThe project's attestation UID
communityUID
YesThe community/program UID (bytes32) that funded the project
title
YesGrant title (1-200 chars)
description
NoGrant description (max 5000 chars)
amount
NoFunding amount as string (e.g., "50000")
proposalURL
NoLink to the grant proposal
programId
NoProgram identifier (see below)

Finding the programId

If the user provides a program/track name but not a
programId
, look it up:
bash
# Accepts community slug (e.g., "optimism") or UID (0x...)
curl -s "${BASE_URL}/communities/${COMMUNITY_SLUG_OR_UID}/programs" | python3 -c "
import sys, json
data = json.load(sys.stdin)
programs = data if isinstance(data, list) else data.get('payload', data.get('data', []))
for p in programs:
    print(f'Name: {p.get(\"metadata\", {}).get(\"title\", \"N/A\")} | ID: {p[\"programId\"]}')
"
Use the matching
programId
value in the request params.

Finding UIDs

Project UID — search by name:
bash
curl -s "${BASE_URL}/v2/projects?q=PROJECT_NAME&limit=5&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for p in data.get('payload', []):
    d = p.get('details', {})
    print(f'Title: {d.get(\"title\", \"N/A\")} | Chain: {p[\"chainID\"]} | UID: {p[\"uid\"]}')
"
Community UID — browse communities or get by slug:
bash
curl -s "${BASE_URL}/v2/communities/?limit=10&page=1" | python3 -c "
import sys, json
data = json.load(sys.stdin)
for c in data if isinstance(data, list) else data.get('payload', data.get('data', [])):
    d = c.get('details', {})
    name = d.get('name', 'N/A') if isinstance(d, dict) else 'N/A'
    print(f'Name: {name} | Chain: {c.get(\"chainID\", \"?\")} | UID: {c[\"uid\"]}')
"

Natural Language Mapping

User saysAction
"add a grant from the Offchain Super Chain program to project X"Look up project UID, community UID, and programId from programs list
"add a grant to project X"Look up project UID, ask for community and grant details
"project X received $50K from Optimism"Look up project + community UIDs, ask if it's a specific program or generic grant
"add funding from program Y to project X"Look up community UID + programId for program Y, then create grant
"create a grant for 0xabc... from 0xdef..."Use UIDs directly
Important: When the user mentions a specific program name, always look up the
programId
via the programs API and include it. Without
programId
, the grant won't appear under that program on the website.

Making the Request

bash
BASE_URL="${KARMA_API_URL:-https://gapapi.karmahq.xyz}"

curl -s -X POST "${BASE_URL}/v2/agent/execute" \
  -H "Content-Type: application/json" \
  -H "x-api-key: ${KARMA_API_KEY}" \
  -d '{
    "action": "createGrant",
    "params": {
      "chainId": 10,
      "projectUID": "0xproject...",
      "communityUID": "0xcommunity...",
      "title": "Optimism Builder Grant",
      "description": "Funding for protocol development",
      "amount": "50000",
      "proposalURL": "https://gov.optimism.io/proposal/123"
    }
  }'

After Success

Display the result using the standard output format. The grant will be automatically indexed by the system.

Edge Cases

ScenarioResponse
Project or community name given instead of UIDLook up UIDs via the APIs
Community not found"Could not find that community/program. Provide the community UID directly."
Amount with currency symbolStrip the symbol and convert (e.g., "$50K" → "50000")
Missing community UIDThis is required — ask the user which program/community funded the project