Skip to main content

PKU236: Missing Function Property

Error Message

[PKU236] No valid 'func' property for [route|tool|resource|prompt|task|processor] '[name]'.

What Went Wrong

Your wiring configuration is missing the required func property, or the function provided is not a valid pikkuFunc.

How to Fix

Make sure you provide a valid pikkuFunc for your endpoint:

HTTP Route Example

import { wireHTTP } from '@pikku/core/http'
import { pikkuFunc } from '#pikku'

const myHandler = pikkuFunc(async (input: { name: string }) => {
return { message: `Hello ${input.name}` }
})

wireHTTP({
method: 'post',
route: '/api/greeting',
func: myHandler, // ✅ Add this
})

MCP Tool Example

import { addMCPTool } from '@pikku/core/mcp'
import { pikkuFunc } from '#pikku'

addMCPTool({
name: 'myTool',
description: 'Does something useful',
func: pikkuFunc(async () => {
// ✅ Add this
return { result: 'success' }
}),
})

Scheduled Task Example

import { addSchedule } from '@pikku/core/scheduler'
import { pikkuFunc } from '#pikku'

addSchedule({
schedule: '0 * * * *',
func: pikkuFunc(async () => {
// ✅ Add this
// Run every hour
}),
})

Common Mistakes

  • Omitting the func property entirely
  • Providing a regular function instead of a pikkuFunc
  • Providing null or undefined as the function value
  • Misspelling func as function or handler
  • PKU559 - Function Metadata Not Found